Wings 3D Development Forum
YafaRay UV Cube XML Code - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Programming (https://www.wings3d.com/forum/forumdisplay.php?fid=7)
+--- Thread: YafaRay UV Cube XML Code (/showthread.php?tid=146)

Pages: 1 2


YafaRay UV Cube XML Code - oort - 01-22-2013

I finally figured out the YafaRay.xml code needed to get image textures to render correctly. The only part that I had wrong was the uv vector values as in <uv u="0.0" v="0.0"/>. After looking at the code exported from the Sketchup YafaRay plug-in I noticed that the code didn't have to be as complicated as the .xml code produced by Blender. I also noticed that it looked very much like the code exported by the Wings3D Pov-Ray plug-in. I wonder if the YafaRay.xml code is based on Pov-Ray??? The code needed for YafaRay is different in the "vertex vectors" section compared to Pov-Ray. If I am not mistaken the uv indices are simply references to the uv vector values??? Below is the code for the mesh section of the .xml code.

Edit: In the code below you will notice that the material is listed once. You can also list the material before each individual face. I am listing the material multiple times in the current version of the Wings3D YafaRay plug-in. Since it works, I will leave it that way for now.

This may not be specific to programming for Wings3D but it may help someone else in the future.

oort

Quote:<!-- Section Objects -->


<mesh vertices="8" faces="12" has_uv="true" type="0">

<p x="-1.0" y="-1.0" z="-1.0"/>
<p x="1.0" y="-1.0" z="-1.0"/>
<p x="-1.0" y="-1.0" z="1.0"/>
<p x="1.0" y="-1.0" z="1.0"/>
<p x="-1.0" y="1.0" z="-1.0"/>
<p x="1.0" y="1.0" z="-1.0"/>
<p x="-1.0" y="1.0" z="1.0"/>
<p x="1.0" y="1.0" z="1.0"/>

<uv u="0.0000000000" v="0.333333"/>
<uv u="0.0" v="0.66666"/>
<uv u="0.0" v="1.0"/>

<uv u="0.0" v="0.3333333333"/>
<uv u="0.0" v="0.666666"/>
<uv u="0.0000000000" v="0.0"/>

<uv u="0.3333333333" v="0.3333333333"/>
<uv u="0.3333333333" v="0.3333333333"/>
<uv u="0.3333333333" v="0.6666666666"/>

<uv u="0.3333333333" v="1.00"/>
<uv u="0.3333333333" v="0.000"/>
<uv u="0.3333333333" v="0.3333333333"/>

<uv u="0.3333333333" v="0.6666666666"/>
<uv u="0.3333333333" v="0.00"/>
<uv u="0.3333333333" v="0.3333333333"/>

<uv u="0.6666666666" v="0.3333333333"/>
<uv u="0.6666666666" v="0.6666666666"/>
<uv u="0.6666666666" v="0.6666666666"/>

<uv u="0.6666666666" v="1.0"/>
<uv u="0.6666666666" v="0.0"/>
<uv u="0.6666666666" v="0.3333333333"/>

<set_material sval="w_Cube2_auv"/>

<f a="3" b="7" c="6" uv_a="5" uv_b="10" uv_c="6"/>
<f a="6" b="2" c="3" uv_a="6" uv_b="0" uv_c="5"/>
<f a="0" b="4" c="5" uv_a="16" uv_b="12" uv_c="11"/>
<f a="0" b="5" c="1" uv_a="16" uv_b="11" uv_c="15"/>
<f a="1" b="5" c="7" uv_a="3" uv_b="7" uv_c="8"/>
<f a="7" b="3" c="1" uv_a="8" uv_b="1" uv_c="3"/>
<f a="2" b="6" c="4" uv_a="9" uv_b="2" uv_c="4"/>
<f a="2" b="4" c="0" uv_a="9" uv_b="4" uv_c="8"/>
<f a="4" b="6" c="7" uv_a="17" uv_b="18" uv_c="9"/>
<f a="4" b="7" c="5" uv_a="17" uv_b="9" uv_c="8"/>
<f a="1" b="3" c="2" uv_a="19" uv_b="20" uv_c="14"/>
<f a="2" b="0" c="1" uv_a="14" uv_b="13" uv_c="19"/>


</mesh>
<smooth ID="0" angle="60.000"/>



RE: YafaRay UV Cube XML Code - Wegg - 03-19-2013

Is there a guide somewhere that walks you through the basics of how to get your YafaRay plugin to work? I think I installed it. . . but then what? How do you render with it?


RE: YafaRay UV Cube XML Code - ggaliens - 03-20-2013

Wegg ... if you end up liking it ... let me know. Just so many renderers. Oort is a great guy ... but his name association with Yafray alone won't sell me. It would have to be great GLASS, METALS, and also dirty procedural surfaces at 1024x767 at maybe 2 minutes per frame or less. That right there would sell me, maybe.

I've been trying RenderMan over and over and am a bit invested in that even if few folks use it.

But I'm trying to revisit old ideas and new ideas and keep eyes open.


RE: YafaRay UV Cube XML Code - oort - 03-20-2013

ggaliens,
I enjoyed playing with your work on the RenderMan plug-in, especially the fast render times... Smile

Would love to see you work on it and release it as a separate plug-in.

oort


RE: YafaRay UV Cube XML Code - ggaliens - 03-22-2013

I'm sure my version of KayosIII's plugin is slow also.

I never spent much time trying to optimize it. Needed to add FAUX shadows to speed it up. Never got there. A buddy of mine is looking for a strong but not to expensive render option for Wings3D / Manifoldlab monsterous large files.


RE: YafaRay UV Cube XML Code - micheus - 03-26-2013

oort, I would like to warn you about new settings for Makefile script added by dgud for the current master branch. The old warnings are not accepted anymore - they are converted to compile error.

So, for the future rebuilds, it's good idea avoid leave unused vars, functions and so on... Wink

Also, by trying compile your latest source I also got this [now a] compiler error:
Code:
f:/unixlike/src/wings/PLUGIN~1/IMPORT~1/wpc_yafaray.erl:3443: ambiguous call of overridden auto-imported BIF max/2
- use erlang:max/2 or "-compile({no_auto_import,[max/2]})." to resolve name clash

it's related to these lines:
Code:
export_rgb(F, absorption, {-math:log(max(AbsR, ?NONZERO))/AbsD,
                       -math:log(max(AbsG, ?NONZERO))/AbsD,
                       -math:log(max(AbsB, ?NONZERO))/AbsD})
You will need to inform where that max come from - as you have you own max code in the plugin source, I think you should use what is suggested:
-compile({no_auto_import,[max/2]}).

I sent you an e-mail.


RE: YafaRay UV Cube XML Code - oort - 03-26-2013

Micheus,
Thanks, I have sent you a response to your e-mail... Smile

oort


RE: YafaRay UV Cube XML Code - Wegg - 03-27-2013

ggaliens: I spent an evening with it and gave up. The render speeds compared to what I can get from messiahConfusedtudio were so so bad. Even when I managed to get threading to work. . . it didn't seem like it was any faster. My CPU fan would go nuts and I'd see it chugging through a bunch of passes of this and that all in text and then when it pooped out an image it looked. . . like. . . Not good. I LOVE Wings3D. But I'll give Yafaray a wide birth. messiahConfusedtudio has such a great renderer that. . . while a fun challenge to figure out. . . with all the redistry "hacking" I had to do. . . it just re-confirmed that I have a good solution with the tool I have.


RE: YafaRay UV Cube XML Code - micheus - 03-27-2013

Wegg, if you are satisfied with your render keep using it - no one wants you moving on.
Some people want realism, others speed,... There are render for all taste, pocket and necessities. Smile

Wings3d doesn't have its own render (only an OpenGL "preview"), so if someone wants to produce a good render for his/her project, he/she will need to export the project to an other 3d application with a best render option. Many people already do that, of course.

But, for those ones that don't want or cannot do that, render application like Yafaray and POV-Ray are a good and cheap option.

I'm sure you would like to try Twinmotion®2 (that claim to be a real-time 3D render - see this video), but I'm not sure you would like to pay €2,420 (I'm not).

I also own messiah Studio 5, but I still prefer play with POV-Ray for render static scene (I like to hack its code).

Wings's plugins needs to be improved and tested. That's why I got into to test Yafaray - and for this, we don't need to care about software performance.


We still have some good and free standalone renders that could have an plugin written for Wings3d - someone interested?
LuxRender

3Delight - It's RenderMan compliant, as the PIXIE used by ggaliens. (free, limited to use only CPU 2 cores)
nice fur, isn't it?

and the abandoned - but good photo-realistic render -Sunflow:



RE: YafaRay UV Cube XML Code - Wegg - 03-27-2013

LuxRender for sure. 3Delingt is only good for 2 cores. Very limiting. :-(