Advertisement Jump to content
Sign in to follow this  

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

This topic is 3551 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). ¿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
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!