sorry, mulitexture problem again

Started by
3 comments, last by sabhat 18 years, 5 months ago
Hi I’ve managed to get two textures blended together which is pretty cool. But the main reason I wanted this was to make it easy texturing roads and transitions between grass & dirt etc. To do this I wanted the first texture to be solid and the second texture to have some areas where it is transparent. I'm using tga's and tried to add a alpha-channel to second texture and make it transparent some areas and then enable blending etc. The problem is that the first texture is also affected by this. I'm doing the multitexture stuff I one pass I think ? (from the tutorial at nehe). So what is the easiest way to do this?
Advertisement
can you deactivate blending when drawing the first texture and then reactivate it when drawing the second?
I'm not sure if that will work cause both textures are drawn at the same time, but I will try it when I get home from school.
Quote:Original post by sabhat
...I'm using tga's and tried to add a alpha-channel to second texture and make it transparent some areas and then enable blending etc...
You don't want to enable blending, that is for blending a fragment with what is already in the framebuffer. For multitexturing you want to look into the GL_ARB_texture_env_combine extension (it was adopted into core OpenGL in v1.3 so you can read more about it in the OpenGL spec, but on Windows you will still need to access it like any other extension). This allows you to combine multiple texture units in different ways.

If you don't want to mess around with texture combiners (getting the effect you want can be tedious) you can just use fragment shaders to combine them however you want. Fragment shaders are by far the easiest way to do this, but they are a pretty large topic by themselves so if you haven't used them yet it may take a little while to get the hang of it.
Thanks Kalidor, as you might have guessed I'm having a hard time getting the hang of this :)

Everytime I read about multitexture / texture-splatting or something similar shaders seem to be the answer. Problem is I dont have any clue about what a shader is. Do I have to learn a new programming language, heard something about GLSL? And how hard is it to implement in my existing project. Also does my graphic card a geforce 4 support this kind of thing?

Basically I would have thought this kind of stuff to be easier in opengl as alot of games do this.

Anyways I'll go and visit google now :)

This topic is closed to new replies.

Advertisement