25 Oct 2013, 02:20
Generic-user-small

Hendri Purnawan (1 post)

Hi Kevin,

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,

Hendri

28 Oct 2013, 17:43
Generic-user-small

Kevin Brothaler (27 posts)

Hi Hendri,

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.

Cheers,

Kevin

  You must be logged in to comment