projective texturing in 2.2

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
bayoubengal
Halfling
Posts: 48
Joined: Wed Sep 05, 2018 3:18 pm

projective texturing in 2.2

Post by bayoubengal » Mon Aug 19, 2019 10:03 pm

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

How would one go about adapting this tutorial to the 2.2 branch?
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4066
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 228
Contact:

Re: projective texturing in 2.2

Post by dark_sylinc » 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)
0 x

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

Re: projective texturing in 2.2

Post by bayoubengal » Tue Sep 03, 2019 3:02 pm

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
0 x

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

Re: projective texturing in 2.2

Post by bayoubengal » Tue Sep 03, 2019 11:48 pm

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?
0 x

Post Reply