PDA

View Full Version : Land of Vertex normals/lightwave &fprime with imported obj comparisons.



prometheus
03-31-2011, 08:33 AM
Hereīs some samples showcasing fprime renders and lightwave perspective cam renders and lightwave classic cam renders with an imported object from solidworks-deep exploration to lightwave, and the issues that shows up with
the different renders and different cams when dealing with vertex normal smoothing.

sometimes I get the renders right with lightwave and sometimes I get screwed up shading, I beleive I do something wrong in the workflow somewhere and I will show that in a second post in this thread and explain a little.
see images and info data on them.

The first image is what to expect using lightwave or fprime and type of camera.
The second image is also what to expect showcasing fprime difference in close up on a logo vs lightwave render with perspective cam.

Michael

prometheus
03-31-2011, 08:38 AM
Now here comes the unexpected result when I had an object in a scene and used that object to copy materials to another machine object, when doing so
the vertex normals are also copied o the new machine object and you would have to switch the vertex normals to the right oneīs in the surface editor.

Im am not sure if this is where it all goes wrong...see the images, I believe Ivé done this before thou without getting it so wrong as in this image.

It just canīt have anything to do with the lighting since it is the same scene setup as in the images posted in the first post, and I believe the export of the normals is ok too.

and yes I know of true arts obj importer, but thatīs not an option right now.

Michael

prometheus
03-31-2011, 09:39 AM
U asked Worley, a fix in works ?

nope..havenīt mentioned that, thought it was commenly know by now, thatīs just an issue of it not being able to handle
vertex smoothing, at least the shading seems to be fine except for the smoothing, but it doesnīt turn up black.

But I rather see it working stable with lightwave native, since the AA is better in lightwaveīs renderer and when vpr advances a little more, that will probably be better to use.

If it is a question of me not working it right or if it is a common buggy problem within lightwave itself remains to track down, so Iīll have to check and resurface the model again that went wrong this time when I get back to work tomorrow.

As mentioned Perspective cam sometimes renders ok in lightwave native render, but sometimes I got weird black shading showing up, need to track down when and where in my workflow that happens.

Michael

prometheus
04-01-2011, 01:15 AM
I tried to reload the same model again and resurfaced again, this time by applying the surfaces from the preset shelf library where I saved the materials from the other machine.

this time It seems to render correct, and I believe I can come to a conclusion that the workflow of having two machines with different vertex maps in the same scene and trying to copy materials over from one machine to the next..Isnīt a good thing to do, even if you make sure to switch vertex normal maps, so my recomendations Is to not do it that way.

I hope this is where it goes wrong and hopefully I wonīt see any more of this unexpected wrong black shading.

the attached image shows that the grey coating on the main beam are correctly now rendered with lightwave perspective cam compared to the images in the previous post, and Itīs the same scene and exactly the same obj format imported and then saved to lwo, the rest of the machine remains to be surfaced properly thou, thatīs why they are blue and some other different colors:)

Michael

Sensei
04-01-2011, 04:05 AM
I don't know why are you repeating this old thing again, and again..

Fprime obviously doesn't support vertex normal, simply because it was programmed in times there was no vertex normal feature! And everybody knows that TrueArt's TrueOBJImport is the only way to have correct normals in the all 3rd party renderers..

I have a theory, what is going on..
In source 3D application the all polygons are double sided, that's it- when you look at front side of polygon and back side of polygon in these applications viewport, there is surface showed.. Not like in LightWave, where back side polygon disappears..
So, these applications don't care whether vertex normals are pointing in the same direction as polygon normal.
And such back side polygon with pointing to back normals is exported.
Then LW imports it, and renderer is hitting polygon - it's back side (Spot Info > Polygon Side in Node Editor)... dot product between such reversed normal and normal from light source, obviously gives black or very dark color...

Everybody who has TrueOBJImport and see above mentioned incorrect normals can try making node tree, which will use Spot Info > Polygon Side (IIRC it will be 0 if back side ray is hitting polygon) to flip normal.
Such math formula

normal = TrueOBJImport
if( backside ) normal = -normal

So, if Spot Info > Polygon Side is 1, normal is passed through without change (like multiplying by 1,1,1)
if Spot Info > Polygon Side is 0, normal is multiplied by -1,-1,-1

If your tests will confirm mine theory, I will update TrueOBJImport to do it automatically. I *DO* *NOT* have such screwed up objects, to test by myself..

Double Sided must be turned on in Surface Editor, otherwise back side polygons are never hit (ray passes through them), and Polygon Side is always 1, IIRC.

Flipping polygon in Modeler is USELESS for this issue.. So, do not do that otherwise Polygon Side will be always 1, and you won't find out which normal to fix..

prometheus
04-01-2011, 04:16 AM
I don't know why are you repeating this old thing again, and again..



Obviously I repeat this again, since Ive been tracking down the issues Ivé had, and as Ivé mentioned it seems to have been cleared up now, as I mentioned in the last post.

I do not need to have double sided on or flip any polys, the errors accoured when I copied materials vertex normals from one machine already surfaced and rendered ok, to another machine within the same scene, most likely that the vertex normals gets mixed up using that workflow and thatīs why I saved them to preset library and applied them from there and then the issue seemed solved( knock on wood)

As you can see the issue seem to have been tracked down for the moment..and I would think that would be helpful for the rest of the community working with solidworks to deep exploration to lightwave,
donīt you think?



Michael

Sensei
04-01-2011, 04:24 AM
How are you doing this copying vertex normal??
LW v10 have some special command for this that I have not noticed?

prometheus
04-01-2011, 04:29 AM
Edit...Yes I know that fprime doesnīt render vertex normals, and I know about your plugin, but I wasnīt repeating that issue, the issues were with lightwave perspective cam renders, and sometimes getting completly ok results and sometimes not, issue was tracked down according to above discussion.

I was copying material from one object machine to another, while doing so, the vertex normals list data is copied over too( at least in surface editors list of vertex normals) that might not be quite true thou, but thatīs what it shows up like in the surface editor, and have to switch vertex normal map to correspond to the right machine exported out.

Edit...but this is as I mentioned not the correct way to surface a different obj with different vertex normals, ergo thatīs why I got the errors.

This is two different machines with two different vertex normals exported out.

Michael

prometheus
04-01-2011, 04:59 AM
Attached images..

here you have further render samples, this is based on the same scene and the left image is rendering completly okey, I still have a little more surface correcting and lighting perhaps to do before finished,
and it is the same obj exported from solidworks to deep exploration to lightwave, the only difference is that I applied the materials from the preset shelf wich was saved from another machine so vertex data are of course not included to screw anything up.

The right image wich is screwed up when I copied materials from the other machine and pasted to the new one, even thou I changed the vertex normals in the vertex normal map list.

The second posted image shows where I changed vertex normals.

I didnīt use lightwave 10 for this but 9.6..but I am doing a switch over gradually an VPR would probably work fine with this and the perspective cam, wich would reduce the need for fprime.

And as you can see in the earlier images" the logos" perspective cam renders the smoothing angles perfectly.


Edit...the black parts on the left image first image, is suppose to be black coating, and the magazin top also and a few things more like plastic lock on the end on beams and some arms, but it should definitly not
look light the right one.

Michael

osiris525
02-03-2012, 09:45 AM
I've been trying for days to fix a similar problem. My object has one vertex normal map associated with it. When that vertex normal map is NOT selected in the Surface editor, the object surface is shaded poorly. When I select that vertex normal map in the Surface editor, the object is smoothed correctly in Open GL, but is has dark shading on it that almost looks likes shadows. These dark area are not supposed to be there. When I render the object, I get ragged, black, shadow-like areas on the object.....these shadow-like areas do not correspond to any of the lights in my scene.

Based on many of the posts by Sensei, it seems like I might be able to fix this using the node editor, but I have not yet seen a clear step by step method on how to set this up. I'm not very experienced with the node editor, so technique shorthand doesn't work very well with me. I do not have access to the original CAD file, nor do I have access to the OBJ file. All I have is the .lwo file. Buying plugins is also not an option for me.

If anyone can help...please do!!!!

prometheus
02-03-2012, 11:28 AM
[QUOTE

If anyone can help...please do!!!![/QUOTE]

I would say Ivé got past those issues now..

1. Use a good conversion tool, I use deep exploration and export to obj format and make sure that smoothing getīs exported correctly.

2. Only use perspective cam..thatīs the only thing that works, classic cam does not, neither does fprime. (unless buying true artīs true obj loader)

3. Do not rotate or do changes on the vertices off the mesh in modeler.
Center object works fine thou.

So make sure you use perspective cam.
Thatīs it.

Michael

MSherak
02-03-2012, 11:43 AM
Now here comes the unexpected result when I had an object in a scene and used that object to copy materials to another machine object, when doing so
the vertex normals are also copied o the new machine object and you would have to switch the vertex normals to the right oneīs in the surface editor.

Im am not sure if this is where it all goes wrong...see the images, I believe Ivé done this before thou without getting it so wrong as in this image.

It just canīt have anything to do with the lighting since it is the same scene setup as in the images posted in the first post, and I believe the export of the normals is ok too.

and yes I know of true arts obj importer, but thatīs not an option right now.

Michael

The vertex normals are one way and the facing polygon normals are another.. I get this from Maya when peeps model without backface culling on.. So the true poly normal is flipped.. Two ways to fix it.. 1) at the source package of the model 2) nuke the normals and surface it LW style..