Wings 3D Development Forum
POV-Ray [plugin] (updated: 2016/Aug/08) - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Design & Development (https://www.wings3d.com/forum/forumdisplay.php?fid=6)
+--- Thread: POV-Ray [plugin] (updated: 2016/Aug/08) (/showthread.php?tid=75)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14


RE: POV-Ray plugin [update] - maker - 12-22-2012

(12-21-2012, 11:36 PM)micheus Wrote: These objects emiter (objects looking like ligths), do they produce soft or sharp shadows?

It depends on whether it's specified as a point light or an area light. (I haven't used it either, as most programs don't support this in translation.) If it'll help, here's the relevant part of the Pov-ray help file:

2.2.4.6.2 Assigning an Object to a Light Source
Light sources are invisible. They are just a location where the light appears to be coming from. They have no true size or shape. If we want our light source to be a visible shape, we can use the looks_like keyword....
.....
Rendering this we see that a fairly believable light bulb now illuminates the scene. However, if we do not specify a high ambient value, the light bulb is not lit by the light source. On the plus side, all of the shadows fall away from the light bulb, just as they would in a real situation. The shadows are sharp, so let's make our bulb an area light:

light_source {
<0, 2, 0>
color White
area_light <1, 0, 0>, <0, 1, 0>, 2, 2
adaptive 1
jitter
looks_like { Lightbulb }
}

We note that we have placed this area light in the x-y-plane instead of the x-z-plane. We also note that the actual appearance of the light bulb is not affected in any way by the light source. The bulb must be illuminated by some other light source or by, as in this case, a high ambient value...

HTH Smile


RE: POV-Ray plugin [update] - micheus - 12-22-2012

Sorry for make this post long, but I need show the informations I got before ask some questions. Thanks for any help/idea/comments...


(12-22-2012, 02:54 AM)maker Wrote: It depends on whether it's specified as a point light or an area light.
Yes, and POV-Ray allow us to use "virtually" any kind of light for that object (virtually because I don't think others than these ones can be useful):
Parallel light:
[Image: testpov3parallel.th.png]
Point light (the default type - set by the omission of a type of light):
[Image: testpov3pointlight.th.png]
Cylinder light:
[Image: testpov3cylinder.th.png]
Spot light:
[Image: testpov3spotlight.th.png]
Shadowless light:
[Image: testpov3shadowless.th.png]

The "area_light" term can be assigned for any kind of light - it is used exactly to produce soft shadows (compare them with the images above - see the box shadow):
Area light definition (Point light+area light ):
[Image: testpov3arealight.th.png]
Spot light + area light definition:
[Image: testpov3spotlightareali.th.png]

So, Wings3d has only a menu option: "Object to Area light". Now, we know that the exporter is always creating a point light with soft shadows.
If we want to turn the object an emitter but producing sharp shadows, will we need to hack the .pov file?

That was the first aspect that drove me to make that question...


maker Wrote:We note that we have placed this area light in the x-y-plane instead of the x-z-plane. We also note that the actual appearance of the light bulb is not affected in any way by the light source.
... and this was the second. Smile

After do some tests I noticed that when we use the term looks_like combined with area_light in the light definition the axis vectors (orientation) for area light doesn't matter...
Here a scene with an regular area light added to Wings3d scene:
[Image: povrayscene2.th.png]
below is the result (the small size and orientation produce shadows in the wall - compare it with that one in the previous post):
[Image: testpov4.th.png]

... but the size of this area is very important

The test environment:
Code:
- one Parallel light
- one sphere converted to an Area light 4x4 (1un diameter):
-> the object had two materials before being converted: half red + half blue;
-> its color was set to White.
- one sphere (1un diameter - smoothed);
- one cube (1un HxWxD).
[Image: povrayscene.th.png]


maker Wrote:The bulb must be illuminated by some other light source or by, as in this case, a high ambient value...
... and that would be the third. Biggrin

The object-light without Ambient influence (Ambient <0,0,0>):
In this situation, you can notice that the source of light came from the middle of the object and you also can observe the texture as it was defined because it's being illuminated by the parallel light.
By comparing these three images you can see that the shadows is growing:
a) area_light <1, 0, 0>, <0, 0, 1>, 4, 4
[Image: testpov3a.th.png]
b) area_light <2, 0, 0>, <0, 0, 2>, 4, 4
[Image: testpov3b.th.png]
c) area_light Love-It, 0, 0>, <0, 0, 3>, 4, 4
[Image: testpov3c.th.png]
First question:
- How should we determine that size? Would it be by doing something like getting a bbox from the object and using its x-z plane dimension? Would it be the best option?

Now comparing the use of the ambient light property:
without ambient light influence (we see the material of the object):
[Image: povrayarealightambientz.th.jpg]
with ambient light influence - huge value (we see only an light object):
[Image: povrayarealightambientn.th.jpg]

Second question:
- Is there any situation where the material appearance will be relevant? If the object will be only an emitter, do we need exporte all the material/texture information to this kind of light?
It's because sometimes the light color cannot represent what we see:
[Image: testpov3.th.png]

I need these king of informations in order to export correctly the informations.
Let's make this exporter better! Smile


RE: POV-Ray plugin [update] - maker - 12-23-2012

(12-22-2012, 10:07 PM)micheus Wrote: Sorry for make this post long, but I need show the informations I got before ask some questions. Thans for any help/idea/comments...
...
I need these king of informations in order to exporte correctly the informations.
Let's do this exporter better! Smile

Wow, that's some task you've taken upon yourself! Shocked I'll try to help as best as I can, but I'm no expert on Pov-ray. (It was a favourite many years back; then I dropped it; the took it up again because of sketchup-2-pov - su2pov.)

Quote:First question:
- How should we determine that size? Would it be by doing something like getting a bbox from the object and using its x-z plane dimension? Would it be the best option?

fwiw, I think so. Ditto for orientation. Of course, size1 & size2 affect the actual number of pointlights used in the array. For Pov-ray, arealights are a rectangular, or circular, area of pointlights. (A fluorescent light is like an array of 1x4)

The "object as area light" probably exports to "looks like." The light can be pointlight or arealight. (Perhaps 1x1 arealight = pointlight = hard shadows.)

Re. using x-z plane dimension: My feeling is that the (orientation) vector will be (should be?) oriented as in the original object. Thus a "sun" area-light at a lower angle (w respect to object) will cause longer shadows than one higher up.

Quote:Second question:
- Is there any situation where the material appearance will be relevant? If the object will be only an emitter, do we need exporte all the material/texture information to this kind of light?
It's because sometimes the light color cannot represent what we see:

Now I'm confused. Wink IMHO, best would be to export as area-light/point-light. (Material characteristics will be ignored then. The user can always duplicate the object with proper material, if required. (There are certain situations like for neon-lighting, light-bulbs, etc., where material characteristics are important; but it would be probably best to keep things simple.) [Off topic: How would you do a gobo (stencil) light?]

[For Pov-ray, it's not "object as area-light," but a "looks like" light-source. The light-source can be a point-light, spot-light or area-light. It's a lot more flexible, but would confuse many users.]

Slightly off-topic: but I wonder if it would be possible to (re-)export only objects / materials. That way we could keep a separate reference (inc) file. To tweak materials, or replace "place-holder" objects with, e.g., cars, pov-trees, humans - at render time. Some time in future, perhaps. (Or, maybe I can check out - and make a tutor - on working from the other end. Smile )

Sorry for the "unnecessary," long additions to the reply. And if I misunderstood any of your questions. Smile


RE: POV-Ray plugin [update] - micheus - 12-23-2012

(12-22-2012, 12:30 AM)oort Wrote: I am only familiar with YafaRay meshlights and the ones I have done are more like glow in the dark marbles... I think they are used for neon or florescent lights???
[Image: th_Meshlights.jpg]
oort, did you export the scene directly from Wings to get this result?

In POV, I couldn't find a way to produce that result. When we use looks_like the object attached doesn't block light - so, no shadow.
To make a scene like yours I would need to tweak the pov file and use union - like explained here:
[img=320x140 link=http://img72.imageshack.us/img72/7264/povrayarealighttest2.png]http://img72.imageshack.us/img72/7264/povrayarealighttest2.png[/img]
yellow ball left using looks_like and the right one is using union (did you noticed that smallest dot on the bottom of the left ball? It seems to be the point light Confused).


(12-23-2012, 05:34 AM)maker Wrote: ... Of course, size1 & size2 affect the actual number of pointlights used in the array. For Pov-ray, arealights are a rectangular, or circular, area of pointlights. (A fluorescent light is like an array of 1x4)
maker Wrote:Re. using x-z plane dimension: My feeling is that the (orientation) vector will be (should be?) oriented as in the original object. Thus a "sun" area-light at a lower angle (w respect to object) will cause longer shadows than one higher up.
I think I could not express myself right here. I will try do better. Smile

The current area light (exported by Wings - and that I wont change anything) uses the plane dimension as the area for "scatter" the point lights and the orientation POV will find by using its face normal.

For the "new" option that we are taking about here we don't have any orientation, because the object can be irregular.
By being a rectangle/square or circle/ellipse the amount of area defined by AXIS_1_VECTOR, AXIS_2_VECTOR in the area_light declaration (that I need to export to POV) will define the amount or how softly are the shadows produced by an object.

I made a new image putting the pictures side-by-side - maybe you can see better what I'm talking about:
[img=640x140 link=http://img405.imageshack.us/img405/8681/arealightsquaresize.jpg]http://img405.imageshack.us/img405/8681/arealightsquaresize.jpg[/img]
the point light array was defined as 8x8, but the area of the plane is: 0.5x0.5, 1x1, 2x2 and 5x5
Please take a look at 2.4.7.5 Area Lights (it will explain better than me Smile), mainly from the middle of the page when they talk about circular and orient.

The user can mark these options in the Light Properties to be exported, but - by considering the last picture in the link above - without the right definition for light orientation the user can obtain wrong shadows.

At this point I'm just explaining the situation, because I don't have idea about how we would workaround this.

maker Wrote:IMHO, best would be to export as area-light/point-light. (Material characteristics will be ignored then).
...
but it would be probably best to keep things simple.)
That's exactly what I would hear. It'll make my life easy. Biggrin

maker Wrote:[Off topic: How would you do a gobo (stencil) light?]
Sorry, Is this a question for me. (my english is a little restrict) Blush

maker Wrote:Slightly off-topic: but I wonder if it would be possible to (re-)export only objects / materials. That way we could keep a separate reference (inc) file. To tweak materials, or replace "place-holder" objects with, e.g., cars, pov-trees, humans - at render time.
Yeah, we can think about it in the future.

Thanks for all comments.


RE: POV-Ray plugin [update] - oort - 12-23-2012

Quote:oort, did you export the scene directly from Wings to get this result?

Yes, all the YafaRay renders I post are pure Wings3D/YafaRay without any editing after export... Smile

Edit: in old Yafray you had to use Wings3D command "object to area light", which converted a mesh to an area light. I think meshlights are supposed to be much more efficient. Area lights with lots of faces took a long time to render.

I will be very slow to respond today.
oort


RE: POV-Ray plugin [update] - maker - 12-23-2012

Sorry for the delay. I was experimenting in Pov-ray, trying to understand their "looks like" (But looks like I couldn't Biggrin )

(12-23-2012, 01:20 PM)micheus Wrote:
(12-22-2012, 12:30 AM)oort Wrote: I am only familiar with YafaRay meshlights and the ones I have done are more like glow in the dark marbles... I think they are used for neon or florescent lights???
[Image: th_Meshlights.jpg]
oort, did you export the scene directly from Wings to get this result?

In POV, I couldn't find a way to produce that result. When we use looks_like the object attached doesn't block light - so, no shadow.
To make a scene like yours I would need to tweak the pov file and use union - like explained ...

Do glowing objects really shadows? I would have thought they didn't.

Quote:For the "new" option that we are taking about here we don't have any orientation, because the object can be irregular.
By being a rectangle/square or circle/ellipse the amount of area defined by AXIS_1_VECTOR, AXIS_2_VECTOR in the area_light declaration (that I need to export to POV) will define the amount or how softly are the shadows produced by an object.
...
the point light array was defined as 8x8, but the area of the plane is: 0.5x0.5, 1x1, 2x2 and 5x5

That's true. It's quite clear what you're pointing out.

Quote:The user can mark these options in the Light Properties to be exported, but - by considering the last picture in the link above - without the right definition for light orientation the user can obtain wrong shadows.

I'm stumped. I tried to find out how Wings handles it.
From my experiments, it seems it's actually "object as point light" (at center of object.) If you create a huge torus "area light" around a standard cube, only the center of cube is illuminated. Rotation and scaling this make no difference to light.

While if I create an Area Light and move and rotate, the difference can be seen at once.

So I'd suggest exporting it as 1 point light , or a union of point lights (choice in user-preference). Because - if you're using irregular objects - there's really no way of knowing where you want to orient it to. Also, that should match the way it looks in the Wings viewport.

Just my 2c. (And hoping that someone who knows more about Pov-ray will chip in. Meanwhile I'll see if my little brain can think of something better) Smile

Edit: BYW, I hope you don't mind my saying. Your references are to Pov-ray 3.6x. It's now at v3.7(RC6)


Object and Area light - micheus - 12-25-2012

I'm working in the POV-Ray plugin in order to fix the exporting crash when an object was converted to an area light (option Object To Area Light). It's happening because until now it was expected to process an object with only four vertices (the conventional Area light).

But, by testing the changes and checking some source codes for add some options I got again in an old problem: the context menu for this kind of light is the same shaw for mesh objects.

The code treats this special light only to include in the context menu an option to revert light to object (option Area Light to Object).

I checked the wings_light:menu() and it's ready to process this kind of light - although that never happens.

also, to convert an object into light should be (probably) the last user action before finishing the scene.

that said, I believe that the right work-flow for this should be:
Code:
- to model the object and convert it into light;
  -> from this point, the object is only a light - and Wings will treat as such.

... and, what about if the user decided to change the shape?
Code:
- convert back the light into object;
  -> from this point, it is only a object again - and Wings will treat as such.

I would like to listening to someone else about this concept/idea.

TIA
Micheus


RE: Object and Area light - maker - 12-25-2012

Just one thing, if I may say so:

Right now - my tests show - Wings treats the "Object as Area Light" as (1?) point light placed at center of object. The object's size or shape or angle have absolutely no effect on the lighting. And (to me) this seems quite right. Or else, as you pointed out, it could be a mess to guess the orientation the user wants.

I'm not sure, but I don't think Pov-ray has a concept of meshlights. Though, afaik, using radiosity, an Ambient Finish >1 makes the object light-emitting (in v3.6x. In v3.7, it is probably "Emission.")

Good luck Smile


RE: Object and Area light - micheus - 12-25-2012

Still there is the option to mix both menus (object and light), but I'm not sure to be appropriated and I'm not the person to decide about this - that's why I started this threread.


I wouldn't like to bring for this thread that discussion/brainstorm we are having in POV-Ray plugin thread but, it seems to be necessary some comments here. Smile

(12-25-2012, 07:19 PM)maker Wrote: Right now - my tests show - Wings treats the "Object as Area Light" as (1?) point light placed at center of object.
Yeah, we already took about it.
The main goal of use (set) an area_light for any kind of light (point,spot,parallel,...) is produce soft shadows, isn't it?
The addition of area_light <vec1> <vec2>, size1, size2(see picture below) to the point light definition (that you can see in the .pov file, after export an Area light from Wings3d) will do that: a point light with soft shadows.

[Image: areal.png]

Quote:The object's size or shape or angle have absolutely no effect on the lighting.
yes, you are right. It doesn't affect the light, but the shadows. That's why the dimension and orientation of the plain defined by vetc1 and vec2 are important.

Did you forget about this image I put in the other thread:
[Image: arealightsquaresize.jpg]
The light is just a bright point in the air and it's not variable, but take a look at the shadows: it's softer for each time I increased the dimension.

also - in accord with the documentation -, yes, the orientation (defined by that two vector) influences too.
Check these two images exported directly from Wings - no .pov tweaked:
[Image: povrayareahoriz.th.png]
Horizontal

[Image: povrayareavertical.th.png]
Vertical


Quote:as you pointed out, it could be a mess to guess the orientation the user wants.
That was before I discover that Area light is not getting its context menu working. If so, we will able to use the same operation we use for Spot, Point and Infinite - use the Position Highlight option in the context menu.

Quote:I'm not sure, but I don't think Pov-ray has a concept of meshlights.
Maybe its not exactly what we would like, but v3.7RC? has improved it - I just discovered these days. There is a new keyword area_illumination in the light statement. See the result:
[Image: testpov5noillunitation.th.png]
object looks_like without area_illumination

[Image: testpov5illumination.th.png]
object looks_like with area_illumination


RE: POV-Ray plugin [update] - oort - 12-25-2012

Merry Christmas Micheus,

Just a quick post to say I tried after upgrading to Pov-Ray 3.62 and I still fail to get a rendered image if no lights are present.

When I have more time I will export a file to see if parallel lights are being exported.

I am simply doing the following...
Add Sphere object.
Render

If I...
Add Sphere object.
Add Ambient light.
Render
Then it works.

Thanks for all your work done this year.
oort