Color float and mat.setFloat()

Hi everybody,

Here is a sample of code.


mat_terrain.setTexture("m_Alpha", assetManager.loadTexture("Textures/Terrain/splat/alphamap.png"));

Texture rock = assetManager.loadTexture("Textures/Terrain/splat/road.jpg");


mat_terrain.setTexture("m_Tex3", rock);

mat_terrain.setFloat("m_Tex3Scale", 128f);


I used to choose a color with 3 floats(RGB), but setFloat() include only ONE - 128f. How can I understand what float to use when I need a green color?


RedGreenBlue, so 1,0,0 = red 0,1,0 = green and 0,0,1 = blue

normen said:
RedGreenBlue, so 1,0,0 = red 0,1,0 = green and 0,0,1 = blue

ok, and what float it will be in setFloat()?

There is no setFloat for color, use setColor…

See my code above.

I try to mix texture of terrain using alphamap. There are method setFloat() for certain texture.

Actually, this code was coped from terrain tutorial, And I try to understand how to mix textures of terrain.

I understand my mistake. SetFloat() means not colour but size of texture.Sorry for wasting time.