Smoth lighting

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
venusian
Posts: 5
Joined: Sat Nov 01, 2014 2:53 pm

Smoth lighting

Post by venusian »

Hello.

I've got some models imported from AC3D via 3ds format. Although I can mark the surfaces as "smooth" in AC3D once in Irrlicht the dynamic lighting shows distinct edges along each surface. I'd like to get rid of this effect. I've written a couple of software renderers (many years ago) and would have done normal interpolation to smooth out the colour changes but I guess this is rather old fashioned now.

What's the "right" way to do this in Irrlict? (Or at least the right way to achive the same aim: hiding surface edges with smoothed lighting.)

The per-pixel lighting tutorial talks about createMeshWithTangent() in the context of parallax mapping but then requires an external normal map which it then applies to the mesh. I don't understand how I can generate a normal map for a whole model without a 1:1 mapping between uv space and the model surface (which I don't have).

Thanks,
Martin.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Smoth lighting

Post by mongoose7 »

You can call createMeshWithTangents() without a normal map. But you may need parallax mapping to do per-pixel lighting if you are not using your own shader. If you want a flat normal map, go into a paint program and set a colour as (127, 127, 255). Then create a small image with this colour. Make the image a power of 2, like 16x16, though I think you can use a 1x1 image.
venusian
Posts: 5
Joined: Sat Nov 01, 2014 2:53 pm

Re: Smoth lighting

Post by venusian »

Thanks for the reply.

It turns out the answer is to import from a wavefront .obj file, not a .3ds file. You can then turn on Gouraud shading and your edges get smoothed out slightly.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Smoth lighting

Post by robmar »

You need to use a pixel shader that's all. 3ds loader does not support smoothing.
Post Reply