Library Effects
最終更新日03 Sep 2013 08:32
effect
effectという謎の概念単位。このエフェクトはidを通じて<library_materials>で参照されたりする。
属性
- id….このidを通じて<library_materials>で参照されたりする。
profile_COMMON
newparam
テクスチャ情報と結びついているみたいだ。
たとえばこんなのがのってる
<sampler2D> <source>material_0_1_0-image-surface</source> </sampler2D>
texhnique
光に関する情報。
diffuseはテクスチャにしますよ、とか。
lambertっていう項目もある。lambertとは、法線と光源の方向にのみ依存し、視線方向が変わっても同じに見える光で、
拡散光にぴったりな計算式のことである。
extra
こんなの入ってた。
<technique profile="GOOGLEEARTH"> <double_sided>1</double_sided> </technique>
具体例
たとえば、<library_images>でこんな風に書いてあったとする
<library_images> <image id="material_0_1_0-image" name="material_0_1_0-image"> <init_from>../images/texture0.jpg</init_from> </image>
そして、<library_effects>でこんな風に書いてあったら?
<library_effects> <effect id="material_0_1_0-effect" name="material_0_1_0-effect"> <profile_COMMON> <newparam sid="material_0_1_0-image-surface"> <surface type="2D"> <init_from>material_0_1_0-image</init_from> </surface> </newparam> <newparam sid="material_0_1_0-image-sampler"> <sampler2D> <source>material_0_1_0-image-surface</source> </sampler2D> </newparam> <technique sid="COMMON"> <lambert> <emission> <color>0.000000 0.000000 0.000000 1</color> </emission> <ambient> <color>0.000000 0.000000 0.000000 1</color> </ambient> <diffuse> <texture texture="material_0_1_0-image-sampler" texcoord="UVSET0"/> </diffuse> <transparent> <color>1 1 1 1</color> </transparent> <transparency> <float>0.000000</float> </transparency> </lambert> </technique> <extra> <technique profile="GOOGLEEARTH"> <double_sided>1</double_sided> </technique> </extra> </profile_COMMON> </effect>