How to blend texture in material script?

asked 2018-10-08 09:48:24 -0600

kumpakri gravatar image

I want to blend two png images to create ground texture, following this tutorial http://wiki.ogre3d.org/Materials#Simp.... I want to take the dirt.png and grass.png and blend it using the terraing.png blend image.

image description dirt.png

image description grass.png

image description terrain.png

I'm using following material script

material GrassGround/Blend
 {
    technique
    {
       pass
       {

          scene_blend alpha_blend

          texture_unit
          {
            texture dirt.png
            scale 0.01 0.01
          }

          texture_unit
          {
             texture terrain.png
             colour_op alpha_blend
          }

          texture_unit
          {
            texture grass.png 
            scale 0.01 0.01
            colour_op_ex blend_current_alpha src_texture src_current
          }
       }
    }
 }

But the resulting texture is only the grass texture.

image description

I have also noticed a note in the ogre documentation that says:

colour_op

Note
    Only has an effect with the fixed-function pipeline or the RTSS: Run Time Shader System

Might that have anything to do with the fact, that the script doesn't work as I expect it to? I don't know what fixed-function pipeline or RTSS is. Can I switch it on or something? Might there be another problem?

edit retag flag offensive close merge delete