Sign in to follow this  
sabhat

sorry, mulitexture problem again

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 :)

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