light and shadow on object

Started by Dune, December 14, 2015, 12:22:07 PM

Previous topic - Next topic

Dune

I'm trying to make an ST tree from an imported mesh (Lightwave, then MUD-sculpted obj, taken through Poseray, where it looks good, with normals ok, then imported in ST), but when I render in TG the light is not calculated properly; the whole trunk is in shadow (while branches added in ST do render the right way). The strange thing is, that it looks okay in the preview. I guess it's a problem with the trunk, but I can't get my finger on it. It's not the shadow of the leaves!

Does anyone of you have any ideas?

Kadri


An unfortunate camera angle can sometimes hide things like flipped polygons.Have you tried it Ulco?

fleetwood

Very odd about the preview treatment, don't have a solution, but can't get away from the impression that somewhere along the chain the trunk is being evaluated as if inside out.

masonspappy

Are the tree bark images solid right to the very edge?  Or is there a thin margin that is actually transparent?

paq

#4
Hi Dune,

Looks like a normal problem. I have seen this often when geometry are mirror and the vertex normal not updated.

- Did you scale the object negatively (mirror) during the process ?
- Is there any normal map applied to the object ?

I'm still not sure of your process : so the trunk is build in lw, sculpted in mud box, export into ST for the additional branching ? Then you export the whole tree for terragen ? (in .obj ?).
Would be easier to check out if you can provide a piece of the trunk geometry ^^ What if you flip the polygons normal (F ?) in LW before exporting to Terragen ... and be sure vertex normal channel is killed too before exporting ?


Gameloft

Matt

#5
Is the sun coming from the left or the right? (Ignore what the tree looks like)

Question 2: What does it look like if you render with shadows disabled?
Just because milk is white doesn't mean that clouds are made of milk.

Dune

Sun is coming from the right, I'll try a render with no shadows. Here's a render made with normals flipped (in TG), so that's not the solution either (it's even stranger). I guess you're right, paq, that is has something to do with normals.
The process was; make simple trunk in LW, map in LW, enlarge 100x in Poseray and export as obj (vertices welded, normals smoothed, recalculated, and also saved), get rid of T-shapes of exported obj in Balancer (which often cause problems in MUD), import in MUD (indeed, there were UV problems mentioned, but I forgot what. But UV map is not exactly within boundaries of mapping area, that I know), increase vertex density 2 levels, sculpt, export as obj. Import in Poseray again, reduce size x0.01 to normal size again, save as obj, import in TG....
A normal map is applied, if you mean bump. I'll see what happens if I turn bump off. That may also be a sign of inverted polys, indeed. But I wouldn't know where they would have been inverted. What do you mean by 'killing the vertex normal channel'?
I'll get the trunk from my other machine and post if I can't figure this out.

Tree bark image is solid.

Dune

I think something went flipping halfway, as branches have a different face orientation (or flipped normals) than the trunk. I will try a completely new trunk and do it more carefully, see what happens.

Dune

I did another one and found out it goes wrong in Speedtree. Here's an exported trunkmesh from ST, if anyone can find out what is wrong here, I'd be much obliged. Normals in ST look good, texture also, but it's dark in TG.

So I exported branches separately from ST and merged with the LW-MUD-trunk obj in Poseray. With a little fiddling that works (strangely the branches were not fitting exactly as it was in ST), but it would be better to do it all in one go.
In ST the way to go is to make a default flat 24-poly (or so) mesh, import the trunk geometry and assign it to that mesh. I think something with the lighting calculation goes wrong there, although that's not visible in ST. E.g. you can't work on the texture or coordinates anymore of that imported trunk.

Maybe the other way round would be better; make a tree in ST, export, separate the trunk and work on it in MUD, then combine again.

Some images:
olive trunk from MUD
olive in ST
olive total in TG
trunk normals in ST
trunk obj
2 renders of Poseray combined tree

j meyer

The trunk you posted was indeed flipped (selectable faces inside).
Attached is a flipped version.
You should not use Poseray to scale objects - as mentioned earlier - as that can
cause strange troubles sometimes.Do that in LW.Just my opinion.
UVs are a bit messed up too.Holes and some faces at the topmost boundary are
oddly stretched.

Dune

#10
Hey Jochen, thanks a lot. I'll dive into this again. Mapping was done quite crudely for this test, so that's what's causing the stretching. I have to find a good way to properly map a base trunk before sculpting on it. I'm no good at mapping in any other software.
Still strange that ST shows normals poiting outward and still exports a flipped mesh... I still have to try flipping it before exporting, and keeping the branches normal (as they are ST).

TheBadger

Its quite a nice looking tree any problems aside. Well worth the effort I would say.
It has been eaten.

Dune

Solved. Somehow the imported mesh is inverted in Speedtree, but if you flip the normals it's exported the right way. Simple actually. Thanks again for all your input, guys.
Here's also a view of how you can work on individual assets in ST, very... VERY handy!

bobbystahr

Currently praying for my program angel to drop this in my computer, heh heh  heh...ST makes me drool
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

j meyer

Yea,glad to see it was just a matter of flipping normals.