Adding small displacement to imported object

Started by reck, April 20, 2008, 10:30:08 AM

Previous topic - Next topic

Mohawk20

Quote from: Ogre on April 22, 2008, 12:43:27 PM
According to Maya the Normals on most of the object were flipped. I fixed and attached.
Sorry but I could not let 3d max get a hold of it.... :P

Ohw well, you beat me to it anyways... good job, hope it helps... I'll play with it as soon as I get home in about 3 hours!
Howgh!

Ogre

Reck

Here is a screen capture of the model before and after. I am not sure what your program is showing or what may have changed on export.
"If you find me feeding daisies
please turn my face up to the sky and leave me be watching the moon roll by.
What ever I was it was all because I've been on the town washing the BS down."

-Gordon Lightfoot

Matt

With imported objects Terragen does not account for displacement when calculating shadows (the shadow-casting object is not displaced, but the shadows are cast onto a displaced surface). This means that if any part of the object has negative displacement it will be plunged into shadow. Some of the renders I've seen in this thread look like that may be happening.

To test this, simply disable shadows in the renderer.

If that's the problem, there's an easy solution. You can prevent the negative displacement by increasing the displacement offset. If using the Default Shader to perform displacement, there's a displacement offset parameter. If you're using the Power Fractal's built-in displacement options then you can adjust the offset there. I would start with something like double whatever amplitude you have chosen.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Mohawk20

Quote from: Matt on April 22, 2008, 03:32:07 PM
(the shadow-casting object is not displaced, but the shadows are cast onto a displaced surface)

I hope I misunderstand, because this sounds like imported objects cannot be displaced..?
Howgh!

Matt

#34
You will see the displacement on the object and it will affect the shading. It's just that ray-traced shadows don't work 100% correctly. As long as your displacements are not too large and you use a displacement offset that's just large enough to fix the unwanted black parts, then it usually looks fairly good.

There can be some other side effects if displacements are large. The renderer may cut off parts of the object in extreme cases. But it works reasonably well.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Mohawk20

Okay, thanks for clarifying.
One last question though... the settings must be extremely low for this to have a nice scale on the object. Why is that? Because of the object, because of flaws in the object, or because an external factor?

I can't seem to get it to work, and it's late on this side of the planet, so I leave it to you, Ogre and Reck, to figure it out in the mean time.
Howgh!

reck

#36
j meyer, I went back and checked the normals again and I did find a handful of faces where the normals were flipped the wrong way. I think there were only 6 faces so it seems there is more to it then this. I used Blender to create the object and then ran it through poseray.


Ogre, I downloaded your fixed version, thanks, but there doesn't appear to be any improvement in the way the object renders in TG. As you can see in the previous screengrab I posted, Blender is showing the normals flipped the correct way so I can only assume either the export feature of Blender flipped them inwards or poseray did.

reck

Hmm I think Matt has identified the problem. As he suggested i've disabled the shadows and re-rendered and straight away it fixed the problem (apart from having no shadows).

Now that we know what the cause is I can take a look at Matt's "easy solution" involving the displacement offset.  ;D


reck

I'm not having much look getting the displacement offset to fix the problem. As soon as I turn shadows back on I just get a black image no matter what I set the offset to.

The displacement setting in the power fractal is turned off, i'm just using the displacement setting in the default shader. In the previous image I had the displacement multiplier set to 0.15. I started off setting the offset to 0.3, then 0.4,0.5,0.6 and then very small values such as 0.1, 0.05 and 0.002. In all cases I just get a black rendered object.

Matt

#39
Can you try with a negative offset instead? Just in case the normals are wrong.

Alternatively, try enabling "flip normals" in the object reader.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

DeathTwister

QuoteAccording to Maya the Normals on most of the object were flipped. I fixed and attached.

Quote from: Mohawk20 on April 22, 2008, 02:45:58 PM
I'll open it up in 3DsMax and see what I can do...

Sorry but I could not let 3d max get a hold of it.... Tongue

Chuckles.... been following this one, very interesting guys, be cool when it gets figured out. I see no Planetside Staff peeps either. Must mean ya'll walking virgin terratory here and they don't have a clue yet either, but I bet Oshyan is working on it /winks.

  If I can find the time I would like mess with this one as well, but not atm to busy, so good luck, I will follow this one,  Good thinking guys WTG.
Maylock Aromy DeathTwister Stansbury
ATOMIX Productions

sonshine777

#41
Quote from: DeathTwister on April 22, 2008, 11:40:48 PM
I see no Planetside Staff peeps either. Must mean ya'll walking virgin terratory here and they don't have a clue yet either, but I bet Oshyan is working on it /winks.

Matt has had three posts on this page alone, including the one just above yours. I think they have a clue and are on the job. ;D

j meyer

Managed to fix the normals in wings too and tested the model in
TG again and anything worked fine displacement included,but since
ogre had already posted his fixed version i deleted mine together
with the screenshots of the displaced model.The only peculiar thing
that occurred was that that scale values for the displacement had to be
smaller than expected.
Don't know what's going wrong for you.
If you want i can of course download it again and repeat the things
i did yesterday(no worry,can be done quickly) and post the results here.

Ogre

Reck - Regarding displacement and shadows. I tried something here http://forums.planetside.co.uk/index.php?topic=2097.msg20485#msg20485 using a color adjust shader that seemed to help.
"If you find me feeding daisies
please turn my face up to the sky and leave me be watching the moon roll by.
What ever I was it was all because I've been on the town washing the BS down."

-Gordon Lightfoot

reck

Thanks everyone for the help on this, it's finally working. In the end it was simple, well simple when someone who knows what they are doing tells you what to do. As Matt suggested I used negative offset and it worked first time. So the normals, for whatever reason, were pointing the wrong way.

Ogre, thanks for the link, i'll take a read.