projective texturing in 2.2

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


bayoubengal
Halfling
Posts: 48
Joined: Wed Sep 05, 2018 3:18 pm

projective texturing in 2.2

Post by bayoubengal »

http://wiki.ogre3d.org/Intermediate+Tutorial+6

How would one go about adapting this tutorial to the 2.2 branch?
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5570
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1405

Re: projective texturing in 2.2

Post by dark_sylinc »

See samples:
  1. Samples/2.0/ApiUsage/Decals
  2. Samples/2.0/ApiUsage/UpdatingDecalsAndAreaLightTex (doesn't show decals, but shows how to update a texture used by decals dynamically, which is the same way it is used for textured area lights)
bayoubengal
Halfling
Posts: 48
Joined: Wed Sep 05, 2018 3:18 pm

Re: projective texturing in 2.2

Post by bayoubengal »

greetings! After figuring out some problems, I have he decal working. But, I dont' see how to do the Frustum part of the tutorial. I want to project the decal across the scene onto whatever surfaces it hits. The further the surface is from the source, the larger it should appear.

-james
bayoubengal
Halfling
Posts: 48
Joined: Wed Sep 05, 2018 3:18 pm

Re: projective texturing in 2.2

Post by bayoubengal »

dark_sylinc wrote: Mon Aug 19, 2019 10:15 pm See samples:
  1. Samples/2.0/ApiUsage/Decals
  2. Samples/2.0/ApiUsage/UpdatingDecalsAndAreaLightTex (doesn't show decals, but shows how to update a texture used by decals dynamically, which is the same way it is used for textured area lights)


I have been experimenting at the following spot in ForwardPlusBase::fillGobalLightListBuffer() to inject a projection matrix into the decal bounds comparison in the shader. I tried a simple scale matrix and got a flickering decal as the camera moves.


*lightData++ = static_cast<float>( invWorldView[0] );

is this concept valid?