1. 程式人生 > >ogre材質指令碼屬性

ogre材質指令碼屬性


頂層Material屬性

屬性名                   值的格式                  描述

lod_distances               <d1> [<d2> ... <dn>]        LOD的距離列表

receive_shadows             <on>|<off>                  陰影是否會投在這個物體上(預設為on)

transparency_casts_shadows <on>|<off>                  透明物體是否投射陰影

set_texture_alias           <alias_name> <texture_name> 重新命名紋理

Technique 屬性
   
屬性名                    值的格式         描述

scheme                       <name>            這個technique所屬的scheme

lod_index                    <number>          這個technique所使用的LOD層(預設為0)

Pass 屬性

屬性名                 值的格式                     描述

ambient                  <r> <g> <b> [<a>] |             這個pass的環境光顏色
                         <vertex color>                  (預設為 1.0 1.0 1.0 1.0)

diffuse                  <r> <g> <b> [<a>] |             這個pass的漫反射顏色
                         <vertex color>                  (預設為 1.0 1.0 1.0 1.0)

specular                 <r> <g> <b> [<a>] |             這個pass的鏡面顏色
                         <vertex color>                  (預設為 0.0 0.0 0.0 0.0)

emissive                 <r> <g> <b> [<a>] |             這個pass的散射光顏色
                         <vertex color>                  (預設為 0.0 0.0 0.0 0.0)

scene_blend              <add> | <modulate>              pass對場景的混合處理
                         <alpha_blend> | <colour_blend> 預設為不透明,不混合

scene_blend              <src_factor> <dest_factor>      場景混合功能的高階控制,引數值有
                                                         one, zero,dest_colour, src_colour,
                                                         one_minus_dest_colour,
                                                         one_minus_src_colour,
                                                         dest_alpha, src_alpha,
                                                         one_minus_dest_alpha,
                                                         one_minus_src_alpha(預設為zero)
   
depth_check              <on> | <off>                    這個pass是否允許深度緩衝檢測
                                                         (預設為on)

depth_write              <on> | <off>                    這個pass是否允許深度緩衝寫入
                                                         (預設為on)

depth_func               <func>                          pass使用的深度緩衝檢測型別,值有
                                                         always_fail, always_pass,
                                                         less, less_equal, equal,
                                                         not_equal, greater_equal,  
                                                         greater (預設為 less_equal).

depth_bias               <offset>                        深度偏移值(預設為0)

alpha_rejection          <func>                          是否允許alpha-reject,值與上面
                                                         depth_func類似(預設為always_pass)

cull_hardware            <clockwise> | <anticlockwise> | 設定硬體頂點背面剔除的型別
                         <none>                          (預設為 clockwise)                                                            

cull_software            <back> | <front> | <none>       設定基於法線剔除的型別

lighting                 <on> | <off>                    是否允許動態光(預設為 on)

shading                  <flat> | <phong> | <gouraud>    設定動態光模式(預設為 gouraud)

polygon_mode             <solid> | <wireframe> |         設定渲染狀態(預設為 solid)
                         <points>
   
fog_override             <true> | <false> [<type>        可以修改霧的設定.型別有none
                         <colour> <density>              linear,exp, exp2; colour
                         <start> <end>                   為RGB顏色值(值在0.0到1.0)
                                                         exp, exp2的density為浮點值
                                                         start和end為linear距離值
                                                         (預設為fog_override false).

colour_write             <on> | <off>                    是否允許顏色寫入

max_lights               <number>                        動態光的數量

iteration                <once> | <once_per_light>       哪重光起作用once_per_light
                                                         point,directional,spot
                                                         預設為(once)

iteration                <number> [<per_light>           指示每種光的重複數量
                                                         (預設為1)

point_size               <size>                          點列表裡點的尺寸(預設為 1)

point_size_attenuation   <on> | <off>                    點的尺寸石灰根據視覺空間   
                         [constant linear quadratic]     進行衰減(預設為off)

point_size_min           <size>                          衰減後的點的最小值
                                                         (預設為0)

point_size_max           <size>                          衰減後的點的最大值
                                                         (預設為0)

point_sprites            <on> | <off>                    是否允許硬體point-sprite渲染


Texture-Unit 屬性

屬性名                 值的格式                     描述

texture_alias            <alias>                          紋理的別名(預設為texture_unit名)

texture                  <name> [<type>] [unlimited |     texture_unit的靜態紋理名.型別為1d
                         numMipMaps] [alpha]              2d(預設),3d,cubic; numMipMaps 為
                                                          自動生成時的數量(預設為unlimited)
                                                          alpha為裝載單個alpha紋理通道

anim_texture             <base_name> <num_frames>         設定動畫紋理使用的圖象
                         <duration>                       根據 base_name 和 zero-based 索引
                                                          建立 num_frames 個圖象.duration為
                                                          動畫的長度.決定了紋理動畫的FPS
                                                          (預設為不使用紋理動畫)

anim_texture             <frame1> <frame2> ...            設定動畫紋理的圖象.
                         <duration>

cubic_texture            <base_name> <combinedUVW|        設定立方圖的圖象, base_name為使用
                         separateUV>                      的圖象名。combinedUVW使用3D地址的
                                                          硬體立方圖.separateUV 使用分離的紋理
                                                          檔案的字尾為_fr, _bk, _up, _dn, _lf, _rt
                       
cubic_texture            front> <back> <up> <down>        設定立方圖的紋理, separateUV 為上面說的
                         <left> <right>                  

tex_coord_set            <index>                          設定紋理使用的紋理座標組.(預設為0)

tex_address_mode         <wrap> | <clamp> | <mirror> |    設定紋理定址方式,預設為wrap
                         <border>

tex_border_colour        <r> <g> <b> [<a>]                定義須定址模式border的顏色
                                                          (預設為0.0 0.0 0.0 1.0)

filtering                <none> <bilinear> <trilinear>    紋理過濾型別(預設為 anisotropic)

filtering                <minification> <magnification>   高階單位紋理過濾型別.minification
                         <mip>                            或magnification可以設定為point,
                                                          linear, anisotropic. mip 的引數
                                                          為 none, point, linear

max_anisotropy           <degree>                         anisotropy的最大度數(預設為1)
               
colour_op                <replace> | <add> |              紋理的混合型別(預設為 modulate)
                         <modulate> | <alpha_blend>

colour_op_ex             <operation> <source1>            高階紋理混合型別
                         <source2> [<manual_factor>]      operation 的引數為source1, source2,
                         [<manual_colour1>]               modulate,modulate_x2, modulate_x4, add,
                         [<manual_colour2>]               add_signed, add_smooth, subtract,
                                                          blend_diffuse_alpha,blend_texture_alpha,
                                                          blend_current_alpha,blend_manual,
                                                          dotproduct,blend_diffuse_color;
                                                          source1 和 source2 的引數為 src_current
                                                          src_texture, src_diffuse,
                                                          src_specular, src_manual;
                                                          manual_factor 和 manual_colour1 基於
                                                          operation, source1 和 source2的值

colour_op_               <src_factor> <dest_factor>       當multitexturing不能使用的時候
multipass_fallback                                        紋理混合使用的回撥方法
                                                          src_factor 和 dest_factor的值
                                                          scene_blend 的類似

alpha_op_ex              (參考 colour_op_ex.)             於colour_op_ex類似但決定的是alpha值
                                                          如何混合.

env_map                  <off> | <spherical> |            允許這個紋理層作為環境貼圖.(預設為off)
                         <planar> | cubic_reflection |   
                         cubic_normal
               
scroll                   <x> <y>                          讓紋理scroll固定的偏移量

scroll_anim              <x_speed> <y_speed>              設定紋理固定速度的動畫scroll

rotate                   <angle>                          設定紋理固定的旋轉(逆時針多少度)

wave_xform               <xform_type> <wave_type>         設定紋理的變形.xform_type的引數有
                         <base> <freq> <phase>            scroll_x,croll_y, rotate, scale_x,
                         <amplitude>                      scale_y; wave_type的引數有sine, triangle,                                                          square, sawtooth, inverse_sawtooth
transform                <m00> <m01> . . . <m32> <m33>    給紋理應用一個4X4的變化矩陣      
lod_index                <number>                         這個technique使用的Detail level
                                                          (預設為0)