浏览代码

Finish modularizing PBRTerrain.j3md

Previously I only modularized AdvnacedPBRTerrain.j3md

But now this PR applies the same concept to PBRTerrain.j3md

I ended up deleting the PBRTerrain.frag file, so now both of the terrain's .j3md files reference the same fragment shader, but the advanced version has a boolean called UseTextureArrays set to true to tell the fragment shader to read from texture arrays instead of normal textures.

I also added suppor for metallicRoughnessAoEi maps in the regular PRRTerrain shader (Ao being ambient occlusion that is packed in blue channel, and Ei being emissiv intensity which gets packed in the alpha channel). You will still be limited to 16 textures without using texture arrays, and as always I'd suggest most people juts use the advanced version of the shader primarily, but atleast the option is there.
Ryan McDonough 7 月之前
父节点
当前提交
06b7b1d4ce
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      jme3-terrain/src/main/resources/Common/MatDefs/Terrain/PBRTerrain.j3md

+ 1 - 1
jme3-terrain/src/main/resources/Common/MatDefs/Terrain/PBRTerrain.j3md

@@ -237,7 +237,7 @@ MaterialDef PBR Terrain {
         LightMode SinglePassAndImageBased
 
         VertexShader    GLSL300 GLSL150 GLSL130 GLSL100:   Common/MatDefs/Terrain/PBRTerrain.vert
-        FragmentShader  GLSL300 GLSL150 GLSL130 GLSL100: Common/MatDefs/Terrain/PBRTerrain.frag
+        FragmentShader  GLSL300 GLSL150 GLSL130 GLSL100: Common/MatDefs/Terrain/AdvancedPBRTerrain.frag
 
         WorldParameters {
             WorldViewProjectionMatrix