Micheus,
I think the code I had for exporting Light Portals was wrong from the beginning. I have done some testing and think I have the fix.
and then the following further down in the code...
An example of exported code is as follows if I am not wrong...
oort
I think the code I had for exporting Light Portals was wrong from the beginning. I have done some testing and think I have the fix.
Quote: lightportal ->
println(F," "),
println(F, "<light name=\"~s\">",[NameStr]),
println(F, "<type sval=\"bgPortalLight\"/>"),
println(F, "<power fval=\"~.10f\"/>",[Lightportal_Power]),
println(F, "<samples ival=\"~w\"/>",[Lightportal_Samples]),
println(F, "<object ival= \"~w\"/>",[Id]),
println(F, "<with_diffuse bval=\"~s\"/>",[Lightportal_Diffusephotons]),
println(F, "<with_caustic bval=\"~s\"/>",[Lightportal_Causticphotons]),
println(F, "<photon_only bval=\"~s\"/>",[Lightportal_Photon_Only]),
println(F, "</light>"),
println(F," ")
end,
println(F, "<mesh id=\"~w\" vertices=\"~w\" faces=\"~w\" has_uv=\"~s\" type=\"0\">",[Id,length(Vs),length(Fs),HasUV]),
export_vertices(F, Vs),
and then the following further down in the code...
Quote: case Object_Type ofChanges above are listed in bold font.
mesh ->
println(F," "),
println(F, "</mesh>"),
println(F," ");
volume ->
println(F," "),
println(F, "</volumeregion>"),
println(F," ");
meshlight ->
println(F," "),
println(F, "</mesh>"),
println(F," ");
lightportal ->
println(F," "),
println(F, "</mesh>"),
println(F," ")
end,
An example of exported code is as follows if I am not wrong...
Quote:<!--Object Name w_LightPortal, Object # 7-->I need to do more testing but I think Light Portals are working with those simple changes. I have not had time to try compiling the suggested changes to make sure they work. I have only exported an xml file from Wings3D and manually edited it and then rendered the modified xml file. I will do more testing tomorrow but wanted to go ahead and post what I had found so far.
<light name="w_LightPortal">
<type sval="bgPortalLight"/>
<power fval="200.0000000000"/>
<samples ival="480"/>
<object ival= "7"/>
<with_diffuse bval="true"/>
<with_caustic bval="true"/>
<photon_only bval="true"/>
</light>
<mesh id="7" vertices="8" faces="12" has_uv="false" type="0">
<p x="-1.2546906412" y="-1.0369074538" z="-0.4884244088"/>
<p x="-1.2546906412" y="-1.0369074538" z="0.1960134569"/>
<p x="-1.2546906412" y="-0.9565645256" z="0.1960134569"/>
<p x="-1.2546906412" y="-0.9565645256" z="-0.4884244088"/>
<p x="-1.6357234410" y="-1.0369074538" z="-0.4884244088"/>
<p x="-1.6357234410" y="-1.0369074538" z="0.1960134569"/>
<p x="-1.6357234410" y="-0.9565645256" z="0.1960134569"/>
<p x="-1.6357234410" y="-0.9565645256" z="-0.4884244088"/>
<set_material sval="w_Light Portal"/> <f a="0" b="3" c="2" uv_a="0" uv_b="0" uv_c="0"/>
<set_material sval="w_Light Portal"/> <f a="2" b="1" c="0" uv_a="0" uv_b="0" uv_c="0"/>
<set_material sval="w_Light Portal"/> <f a="3" b="7" c="2" uv_a="0" uv_b="0" uv_c="0"/>
<set_material sval="w_Light Portal"/> <f a="7" b="6" c="2" uv_a="0" uv_b="0" uv_c="0"/>
<set_material sval="w_Light Portal"/> <f a="0" b="4" c="7" uv_a="0" uv_b="0" uv_c="0"/>
<set_material sval="w_Light Portal"/> <f a="0" b="7" c="3" uv_a="0" uv_b="0" uv_c="0"/>
<set_material sval="w_Light Portal"/> <f a="2" b="6" c="1" uv_a="0" uv_b="0" uv_c="0"/>
<set_material sval="w_Light Portal"/> <f a="6" b="5" c="1" uv_a="0" uv_b="0" uv_c="0"/>
<set_material sval="w_Light Portal"/> <f a="5" b="6" c="7" uv_a="0" uv_b="0" uv_c="0"/>
<set_material sval="w_Light Portal"/> <f a="5" b="7" c="4" uv_a="0" uv_b="0" uv_c="0"/>
<set_material sval="w_Light Portal"/> <f a="1" b="5" c="4" uv_a="0" uv_b="0" uv_c="0"/>
<set_material sval="w_Light Portal"/> <f a="1" b="4" c="0" uv_a="0" uv_b="0" uv_c="0"/>
</mesh>
oort