Jump to content
  • Advertisement
Sign in to follow this  
xnewagex

GLSL texture splatting with several textures and just one texture coordinate system.

This topic is 3309 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

I'm working in a terrain renderer/editor for a game. Well I'm using shaders and I have several textures (2 RGBA textures with the masks + 8 ground textures) to blend in a chunk. But I just need a texture coordinate system because all the textures will have te same size without <<offsets?>> (Well, English isn't my native language, sorry). http://rafb.net/p/8efEsA88.html ¿is that possible? Actually, I link the textures this way. Do I have to use MultiTextures? void Shaders::link_texture(ui32 shader, ui32 texture, char* alias) { GLhandleARB program = m_shaders[shader].p; i32 uniform_location = glGetUniformLocationARB(program, alias); glBindTexture(GL_TEXTURE_2D, texture); glUniform1iARB(uniform_location, 0); // Check shader errors CHECK_GL_OBJECT_ERRORS(program); } The problem is that I allways get the last texture which was bound. I get the same result even if I just use somethink like: void main() { // Sets the first ground gl_FragColor = ground1; } I think it's a problem binding the textures.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!