Sign in to follow this  
JohnRaptis

OpenGL Multitexturing and lightmaps-- help me with an implementation?

Recommended Posts

Hi all,

I'm looking for a way to implement a multi-texturing pipeline without shaders to do an effect. Does anyone know if this is possible, and if it is possible, could give me some code or pseudocode? DirectX or OpenGL, both welcome. The effect I want could be done with a shader, but for other reasons, I must, at the moment, stick with OpenGLES1-- no shaders.

Okay, I have a lightmap.

I have a character I want to light based on one pixel in the lightmap. These are all 2D sprites.

So, if I were doing this with pure source code, it would go something like:

[code]
Color aCharacterColor=mLightmap.GetColor(x,y);
myCharacter.Diffuse=aCharacterColor;
myCharacter.Draw(x,y);
[/code]

So here's the question: Is there some way to do this with multipass texturing?
Could I set up one pass to be the sprite of the character, with the character's UV coordinates... and then another pass with all the uv set to one pixel in the lightmap, the (x,y)... and get the character's color to be multiplied by that pixel?

I'm no expert at the rendering pipeline (after only a couple hours of doing shaders, I am better at shaders than I ever was with the fixed pipeline), but like I said, I need to keep using GLES1 for the time being.

Thanks in advance for your help. Code appreciated!

--John

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this