Transparent texture overlay problem

Hi,

I’m having problems with applying a transparent texture over the top of another, the effect I want is as follows:

http://bencoleman.co.uk/temp/floor-e_resize.png
Base Texture +
http://bencoleman.co.uk/temp/pudd.png
Texture Overlay (with alpha) =
http://bencoleman.co.uk/temp/example_resize.png
Desired result

I’ve tried what seems like every combination of TextureAttributes and various modes but no luck, surely this can be done? Here’s the code I’m using

TextureUnitState tu0 = new TextureUnitState((Texture2D) TextureLoader.tf.getMinMapTexture("floor.jpg"), null, null);
TextureUnitState tu1 = new TextureUnitState((Texture2D) TextureLoader.tf.getMinMapTexture("test.png"), null, null);
TextureAttributes ta0 = new TextureAttributes();
ta0.setTextureMode(TextureAttributes.MODULATE);            // Mode needs changing???
tu0.setTextureAttributes(ta0);
TextureAttributes ta1 = new TextureAttributes();      // Mode needs changing???
ta1.setTextureMode(TextureAttributes.BLEND);
tu1.setTextureAttributes(ta1);

// ????
// Some combination of setCombineAlphaMode and setCombineRgbMode here ????
// The modes are not clearly documented which const values of TextureAttributes apply to each method?
// ????
  
// is order in the array important?
appearance.setTextureUnitState(new TextureUnitState [] {tu0, tu1});

Can anybody help? or at least explain the setCombineAlphaMode and setCombineRgbMode methods

Thanks…

Hi,

I suggest to check

http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_env_combine.txt

as starting point.

OK, this one is too low level maybe… but this is original source - the rest is just interpretations of this one.

Yuri

Look at my tutourial on xith.org site

http://xith.org/tutes/GettingStarted/html/more_fun_with_textures.html