JME3 - Splitting more than three textures

The next tutorial explains how to perform basic texture splitting with height maps.

http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_terrain

I was able to follow this guide and exercises with excellent results. However, I am wondering how to add more than three textures. I see only three texture layers in the material parameters of the Terrain.j3md file: Tex1, Tex2, Tex3, so I do not believe that you can do this with Terrain.j3md.

It is my guess that you should use TerrainLighting.j3md. However, it is structured very differently with parameters like NormalMap and DiffuseMap, and I cannot find documentation / tutorials explaining what exactly they represent.

+5
source share
2 answers

JME3 is an OpenGL-based library that uses GLSL shaders for rendering. You must write your own shader or modify an existing one to do custom rendering.

Shaders are an advanced theme. You can find an introduction to shaders in the SDK documentation. But, probably, you would like to read the full article on "Materials, light, shadow . "

JME3 uses three files to manage them:

  • .vertVertex Shader Code File GLSL
  • .fragGLSL fragment shader code file
  • A .j3mdshader program definition file

- GLSL. Vertex shader , . - ..j3md (), () ..

. Terrain.j3m, :

Texture2D tex4

Terrain.frag:

uniform sampler2D m_Tex4;

, , .

+2

splatting, 12 , .

TerrainLighting.j3md this ( ) , .

+3

All Articles