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
Quote:I do not understand exactly what you mean by assign the material to an object.
I mean I create a house skeleton (first object) and opened two holes on the ceiling. In these holes I placed two grouped windows (second object).
The house uses a regular material (Shiny Diffuse) and the windows I used the LightPortal.

Quote: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?
The first try I did something like this which the pseudo house was one block (object) using two materials. I selected two faces on the ceiling to mimic the windows and applied the LightPortal material on them. That was the option that didn't work.
Micheus,
I am using the same method as you. As you know from my e-mail I am doing more testing to figure out what other things need to be changed in the code. I have just discovered that "type" needs to be set to 256 in the following code. This makes the light portal invisible.

Quote:<mesh id="7" vertices="8" faces="12" has_uv="false" type="256">

I am still working on figuring out how to control which direction (x,y,z) the light photons are being emitted.

Thanks,
oort
I am still hunting for what controls the direction (x,y,z) photons are emitted. I am also playing with some of the settings and have noted the following:
In the Ambient Light/HDRI "Cast Shadows" needs to be enabled.

In the light portal Material settings for Object Parameters "Photon Only" needs to be enabled. Setting the "Samples" setting in the light portal to a value of between 128 to 480 removes graininess without a big impact on render time.

Here is what the plug-in code is so far. The change to object type to make the light portal invisible is in bold.

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=\"256\">",[Id,length(Vs),length(Fs),HasUV]),
println(F," ")

end,

export_vertices(F, Vs),

I will add an image of an example render to this post later today.
Edit: I edited this post to correct the information due to knowledge gained from further testing.

oort
I think that visibility (type=\"256\") may be achieved with the new parameter that was disabled for lightportal. Smile
oort Wrote: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.

I couldn't make your sample file working - no light in the portal on my side. Undecided
I would leave the type=256 hard coded in the export so that the user does not have to change that setting for light portals. Currently it is hard coded as type=0 for Light Portals. Simply changing the 0 to 256 is better I think???

Make sure you check the path for the HDRI image in the Ambient light of the file I sent you. If the HDRI is not found there will be no light.

Here is a test render. I moved my window to the opposite side of the room so that the photon light rays are going into the room. The sphere by the window is made of glass.

Light Portal Test

Large Light Portal Test

Edit: Here is a render without the light portal. Not as big a difference as I expected... Edit2: The reason the following image does not show a big difference in lighting is because the power setting in the Ambient/HDRI was set very high. The power setting should be kept very low if you want lighting to be primarily from the light portal.
No Light Portal Large Test

Thanks,
oort
Thanks to the help of Micheus, light portals are now working in the YafaRay plug-in. I have updated the file for the unofficial plug-in on my website.

The light portal object needs to be created by extracting a face from a cube or other object using the "extract" face command. Light photons will emit in the "Normal" direction of the face that has been extracted. If you need the light photons to emit in a different direction simply rotate the extracted face.

Here are two examples. One with a low power setting and one with a high power setting. The power setting in the Ambient/HDRI is set very low in both examples so that most of the light comes from the light portal instead of the ambient light. Samples is also set to only 64 in the Ambient/HDRI light to avoid longer render times. The Samples setting in the light portal material has a big impact in reducing graininess without a big impact on render time. Samples is set to 480 in both example renders. A power of 4000 was used in the second image.

oort

Low Power Light Portal

High Power Light Portal
Hello,

I received a message from Micheus several days ago asking a question about light portals and object type. Sorry for the delay in answering, but it's been several complicated weeks for me lately.

I see that Oort has already clarified the matter? In any case if you have any issues please send me a scene and I will check.

Best regards.
David,
No need to apologize. Micheus and I were able to solve the problem together. It was all about using the correct Wings3D object when creating the light portal object. Smile

Thanks,
oort
Here is a test of the scene posted by Micheus in a previous post.

Skylight Test

oort
After additional testing I now see that Light Portals work with all Background types (HDRI, Image, Constant, Gradient, and SunSky).

Here is another render of the scene that Micheus created. This time with SunSky background.

Light Portal with Infinite Light /SunSky background

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