Sign in to follow this  

Multitexturing

This topic is 3719 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi... can you give me the tutorial or some information about multitexturing. I have browsing some info from internet about it. But, I only know few about it. I want to use this multitexturing for shadow mapping project with multi light source. Thanx before..

Share this post


Link to post
Share on other sites
i have a tip for you my northern neighbour, there is this wonderfull website i once heard of that actually catologues the internet and than let's you search it's results :-) :-)

i mean seriouslly, type this in google "opengl multitexturing" ...i got 14,700 hits for that search, withough doubt what you are looking for is in there.

Share this post


Link to post
Share on other sites
OK2... I already read some tutorial about multitexturing...
I don't is this topic related with multitexturing or not.. But I want to know, how we can combine two texture or more into one texture?? Because I usually use glBindTexture to move one texture. But, if I use it twice.. The first texture will be deleted. Maybe one of you can give some solution or example code... Thanx

Share this post


Link to post
Share on other sites
Do the maths yourself then.

Load the first texture into your program. Load the second data into your program. Then go through byte-by-byte and perform the operations on the information. Storing it into a new array (or however you store your textures) then create the texture. (DO NOT DO THIS EVERY FRAME)

Share this post


Link to post
Share on other sites
@AndyEsser:
So you mean that to save two texture using glBindTexture... I must create by my math? I cannot use the opengl function for that??

Share this post


Link to post
Share on other sites
There are ways of doing multitexturing using the FFP. However, as Lord_Evil suggested, using shaders would be the easiest way to go.

However, if you do not wish to use shaders, then you can load both textures into memory. And then loop thru each pixel and perform the relevant operations on it

texture1[w*h*3] // Array for holding data for Texture 1
texture2[w*h*3] // Array for holding data for Texture 2
texture3[w*h*3] // Array for holding data for Texture 3

[Loop Through X]
[Loop Through Y]
texture3[x*y+0] = texture1[x*y+0] * texture2[x*y+0]
texture3[x*y+1] = texture1[x*y+1] * texture2[x*y+1]
texture3[x*y+2] = texture1[x*y+2] * texture2[x*y+2]
[End Loop Through Y]
[End Loop Through X]

The code above will _Modulate_ the two colours of each pixel channel in Textures 1 and 2 and store the result in texture3. You can then use glGenTextures() on this array and then glBindTexture() the texture.

Share this post


Link to post
Share on other sites

This topic is 3719 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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