Exercise on Chapter 7 Blending texture.
25 Oct 2013, 02:20
Hendri Purnawan (1 post)
I enjoy the book so far. I am fairly new to OpenGLES 2 and it really helps me moving forward a bit faster.
At the moment, however, I am stucked on chapter 7 exercises. I am wondering if you can shed some lights.
The first exercise, loading a different image is fairly straight forward. I can load another image on top of the blue table, partly covering it.
However, I am lost on how to blend the new image with the current one (blue table). The TextureShaderProgram.java and the texture_shader_fragment.glsl only has one texture unit associated with them. Are we suppose to modify both files to have another new texture unit?
Thanks for any pointers on this one,
28 Oct 2013, 17:43
Kevin Brothaler (27 posts)
Yes, you would need to modify the files to add another texture unit. The source code (available here: http://pragprog.com/titles/kbogla/source_code) has a solution for multi-texturing in the “TakingTheNextStep” folder (see “heightmap_fragment_shader.glsl”), so you could refer to that if you ever get stuck.
|You must be logged in to comment|