Jagged edges in texture projection

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
de3000
Posts: 20
Joined: Tue Sep 19, 2006 4:57 pm
Location: South Africa

Jagged edges in texture projection

Post by de3000 »

I have been using a modified version of the texture projection found in http://irrlicht.sourceforge.net/phpBB2/ ... projection but have come across a problem with texture boundaries causing. The same problem exists for shadow mapping but techniques like PCF solve the problem and I cannot find a way translate it to general texture projection.

Image

The texture on the middle billboard is projected down onto the 8 spheres below the bounding box outline.

Image

First closeup shows the jagged edges and incorrect colouring at projection edges.

Image

View of the scene from which the projected texture was generated showing the texture projection.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

You could fade out the projection with the dot product of the projection direction and the surface normal, this'll make the artifacts almost invisible.

This is part of the reason these artifacts aren't usually visible in shadow mapping, because the nDotL lighting makes them fade out smoothly.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
de3000
Posts: 20
Joined: Tue Sep 19, 2006 4:57 pm
Location: South Africa

Post by de3000 »

I dont think that will work. Here is a textured example.
Image
Image
Image

At the edges the projects "bleeds" up to the top sphere. Edges circled in first post.
Post Reply