Texture images as light

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Texture images as light

Post by dlangdev »

Hi, I'm just wondering if anyone has tried or has any information about light projection using a texture image.

What I'd like to do is project the filtered light of the stained glass onto the floor.

I think it also works like shadows, except no shadows are calculated, instead the texture image is spread around as seen by the stained glass window, then each pixel is written onto the destination point.

Image

Just so you know, I used this Flickr image as my reference.

http://flickr.com/photos/kros/2621117267/sizes/m/
Image
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Sounds like you want projective textures (very similar to shadow map rendering) and blending.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

yup, looks like that's the code i should looking into. tho i have this feeling it has something to do with deferred shading as well. i'm still not sure about the algorithm, i mean how it will get coded.

while i was looking for more clues, i decided to play around with textures more and did a fake version of it.

thanks for the input, that really helped me a lot to where my next steps will be going.

Image
Image
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Yeah just wait till projective texturing is implemented (Almost done.). Heres something I did for an office project:

Image
(Old screenshot does not reflect current state of the project.)
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi, dlangdev

On your scene, to be more accurate, flip your texture horizontaly (check the green part on the ground, it look flipped) (Checked again, not really sure now).

Since your trying to mimic that type of glass, I think the texture projected on the ground would look more blurry, it look too sharp on the ground.

What kind of light have you used? I don't see the window framing shadowing on the ground...

That scene was rendered in IRRlicht or in a 3D package?

If that can be baked as it look now, it should make a pretty nice room for a level! :wink:
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

i'll explain later, i'm stuck right now trying to even understand the projection. the stained glass is actually a quad covering the window, i simply modulate the rgb to simulate emmision. that quad needs to go away so that the projection can pass through the window.

the problem is i'm still studying the projection from the light source passing through the window, hitting the floor. it's like a shadow except it's not a black or gray ramp color, the shadow is a texture color map that's blended again with an alpha ramp or gradient.

with this, i think i'm getting a good idea how material managers are supposed to be written. ah, but that will coded much later, though.

well, the reason the shape of the window not projected is simply because the light is not projected outside the window. it's coming from the inside.

in short, the scene is a quick-n-dirty hack. i need to write the math behind that scene which i find complicated. but i've convinced a lot of people already, they like what they saw, though.

btw, the image was baked, it's a dirty hack.
Image
Post Reply