View Full Version : DXF import and raytracing
06-01-2004, 12:43 AM
When I import a dxf file (from Autocad) into LW, everything looks perfect *until* I do a render with a raytracing light. The light treats the surfaces as though their normals were pointed the opposite way, so the surfaces that ought to cast shadows do not (and surfaces that should not cast shadows--since their normals are pointed the opposite way--*do* cast shadows). The problem does not occur when lights are shadow mapping.
Anyone had this? Any solution?
06-01-2004, 03:13 AM
I notice that the point order of a surface imported through DXF is backward. In LW, to get a normal pointed toward you, you make the points go clockwise. The surfaces that have been DXFed, however, run counterclockwise.
Still can't figure out a solution...
06-01-2004, 03:24 AM
I just found out I have the same problem when I import a 3DS file! Surfaces behave as though their normals are flipped when it comes to shadows from a raytracing light. Mayday...Mayday...
06-01-2004, 03:27 AM
you can use "f" to flip the normals. sorry if that seems obvious.
06-01-2004, 03:35 AM
Sorry, let me be more clear. This image should show what's happening. The normals are correct. The shadow, however, is what it should be if the normals were flipped.
06-01-2004, 04:18 AM
Have you made sure that all the points are merged together?
Also, check your smoothing settings.
06-01-2004, 11:52 AM
The problem persists with and without points merged, and with and without smoothing.
06-01-2004, 12:34 PM
There seems to be some kind of bug getting geometry from Autocad. The same model shown above imports and renders perfectly in VIZ. Has anyone had any trouble importing from Autocad 2004 into LW 7.5c?
06-01-2004, 01:38 PM
I just discovered that in Lightwave surfaces with normals pointing *away* from a raytracing light source cast shadows. Now, why LW does this I can't figure out.
06-01-2004, 02:12 PM
I don't believe that that's really the case with LW, or else it wouldn't be able to raytrace anything properly, and it certainly does.
I'm not sure what file problems you're having, but just set your surfaces to "double sided" for now until someone has a better solution.
06-01-2004, 02:46 PM
According to the manual, a surface's normal must be pointed *toward* the surface *receiving* the shadow (and therefore *away* from the light source). In the image above you get the shadow shown because there is no cap on the bottom.
I don't know why Lightwave does this. VIZ casts a shadow regardless of the direction of the normal. MAX casts a shadow if the surface's normal is pointed toward the light source, as I would expect.
If anyone has any insight into why LW is set up this way, I'd be curious to know the answer. What are the advantages? Seems counter-intuitive to me.
Puzzled in Indiana
06-01-2004, 03:41 PM
Sorry, misread what you wrote.
Okay, LW doesn't handle polys like VIZ. VIZ treats all polys as double-sided. LW renders faster by culling the polys down to just the ones it wants to render shadows for, rendering just for those, and not all polygons.
I understand what I'm seeing in your image and why you are confused. It's not making sense, visually.
I just reproduced the problem, myself, with LW8 as well as LW7.5C with LW objects made in Modeler, though the problem did go away when I made the objects double-sided in the surfaces, like I said earlier. This problem did not occur with shadowmapped spotlights, however.
All I can suggest is that you cap your objects and/or make doublesided when raytracing shadows.
06-01-2004, 03:46 PM
Absolutely right. Now the question is, why would the LW programmers choose to have raytracing lights ignore surfaces whose normals are pointing toward them? Is there any advantage here? I can think of plenty of advantages to MAX's system in which raytracing lights ignore backfaces (you can place lights behind walls, in boxes, etc.)
Is there any other renderer out there which does this?
06-01-2004, 04:11 PM
I imagine it was done to speed up the rendering of shadows. If you calculate the shadow of the front side of objects, as well as the back side of objects, you've calculated twice, where, normally once will do. Certain assumptions are made in this like, "solid objects have identical shadow profiles whether you map from the facing side or the non-facing side." So, the programmers picked a side and went with it.
As far as putting lights inside or behind objects, you can do that and just turn off that object so it won't receive light. This can be done on a per object basis in the Light Properties panel under "shadows" or on a per light basis in the Lights tab of the Object Properties panel.
01-18-2006, 08:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.