Wings 3D Development Forum

Full Version: YafaRay Plug-in
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11
Micheus,
I like where you put the setting. I was just curious if it worked for all object types. Smile

Thanks,
oort
I did some testing today. The "Visibility" setting does work with "Mesh" and "Mesh Light" Object Types.

From what I have seen in my tests, the setting does NOT do anything for "Volume" Object Types. No negative impact but Volume objects still produce shadows. Maybe this feature is not supported with Volumes in YafaRay???

"Light Portal" objects do not produce shadows and it seems they never did. I played with light portals a bit more today while testing the updated plugin and I am not sure that they are even working. Maybe they never worked??? I will have to do more testing of light portals. They are supposed to focus Ambient light (HDRI) coming through windows in a room. Here is a video that describes how light portals are supposed to work in Cycles using Blender... Light Portals explained

Thanks,
oort
oort, these are questions I cannot answer, so I transferred your question to DavidBluecame (here):
This was his answer:
DavidBluecame Wrote:About the visibility setting for Mesh Light and volumes, I would have to
check, but it's possible that it never actually worked.

Light portals are supposed to be just that, not objects casting shadows. As
far as I understand they just bring the background into the scene through
the surface of the portal object.
Micheus,
Thanks for checking with David on this. The visibility setting is working with Mesh Lights. Maybe he can add that feature to Volumes... Smile

What he said about Light Portals matches my results from testing. If that is true I think that the "Visibility" setting should not show up in the dialog when the "Light Portal" object type is selected. That way the user will not think the setting works for light portals.

Thanks,
oort
Thanks for testing and for the suggestion oort.
Micheus,
Thank YOU for continuing to update the plugin. Smile

Thanks,
oort
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.

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 of
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,
Changes above are listed in bold font.
An example of exported code is as follows if I am not wrong...
Quote:<!--Object Name w_LightPortal, Object # 7-->

<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>
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.

oort
I think the code change in the first section needs to be as follows instead of what I posted above.

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, "<mesh id=\"~w\" vertices=\"~w\" faces=\"~w\" has_uv=\"~s\" type=\"0\">",[Id,length(Vs),length(Fs),HasUV]),
println(F," ")


end,

export_vertices(F, Vs),

I did more testing and the code change seems to work with Direct Lighting, Photon Mapping, Path Tracing, Bidirectional Path Tracing, and SPPM. Light Portals work in combination with an HDRI in Ambient lights.

I still have to do more testing to figure out how to control the direction that photons are emitted from the light portal. At this time they always emit along the -X axis of the light portal. There must be some other value needed in the YafaRay xml code to control the direction (X,Y,Z)

oort
Thanks oort.
I already fix that and made a PR to the main repository.

By testing I noticed that although we define the LightPortal in the material, it will works correctly only if we assign it to an object - not to a multi-material one (I mean, assign it to some faces).

In this sample, I just got the light going through the "window" when It was really an object put in a hole I did on the roof/ceiling:
[Image: Light-Portal.png]
Micheus,
Thanks for fixing light portals. Can you please e-mail a copy of the updated plugin to me for testing. Hopefully I can test it tomorrow.

I do not understand exactly what you mean by assign the material to an object. I was using a flattened cube in my testing for the light portal object. I had created a material with the light portal object type setting and assigned that material to all sides of the cube. What have I missed?

No matter what I tried the light was always emitting via the wrong axis of the light portal cube... Sad

Thanks,
oort
Pages: 1 2 3 4 5 6 7 8 9 10 11