@@ -153,6 +153,22 @@ public void onAction(String name, boolean pressed, float tpf) {
153153 isNight = !isNight ;
154154 // Ambient and directional light are faded smoothly in update loop below.
155155 }
156+
157+ if (name .length () == 1 && !pressed ){
158+ if (name .equals ("-" )){
159+ matTerrain .setInt ("DebugValuesMode" , -1 );
160+ }else {
161+ try {
162+ int debugValueMode = Integer .parseInt (name );
163+ matTerrain .setInt ("DebugValuesMode" , debugValueMode );
164+ }
165+ catch (Exception e ){
166+
167+ }
168+ }
169+
170+ }
171+
156172 }
157173 };
158174
@@ -270,14 +286,49 @@ private void setupKeys() {
270286 inputManager .addMapping ("triPlanar" , new KeyTrigger (KeyInput .KEY_P ));
271287 inputManager .addMapping ("toggleNight" , new KeyTrigger (KeyInput .KEY_N ));
272288
289+ inputManager .addMapping ("0" , new KeyTrigger (KeyInput .KEY_0 )); // toggleDebugModeForAlbedo
290+ inputManager .addMapping ("1" , new KeyTrigger (KeyInput .KEY_1 )); // toggleDebugModeForNormalMap
291+ inputManager .addMapping ("2" , new KeyTrigger (KeyInput .KEY_2 )); // toggleDebugModeForRoughness
292+ inputManager .addMapping ("3" , new KeyTrigger (KeyInput .KEY_3 )); // toggleDebugModeForMetallic
293+ inputManager .addMapping ("4" , new KeyTrigger (KeyInput .KEY_4 )); // toggleDebugModeForAo
294+ inputManager .addMapping ("5" , new KeyTrigger (KeyInput .KEY_5 )); // toggleDebugModeForEmissive
295+ inputManager .addMapping ("6" , new KeyTrigger (KeyInput .KEY_6 )); // toggleDebugModeForExposure
296+ inputManager .addMapping ("7" , new KeyTrigger (KeyInput .KEY_7 )); // toggleDebugModeForAlpha
297+ inputManager .addMapping ("8" , new KeyTrigger (KeyInput .KEY_8 )); // toggleDebugModeForGeometryNormals
298+
299+ inputManager .addMapping ("-" , new KeyTrigger (KeyInput .KEY_MINUS )); // - key will disable dbug mode
300+
273301 inputManager .addListener (actionListener , "triPlanar" );
274302 inputManager .addListener (actionListener , "toggleNight" );
275303
304+ inputManager .addListener (actionListener , "0" );
305+ inputManager .addListener (actionListener , "1" );
306+ inputManager .addListener (actionListener , "2" );
307+ inputManager .addListener (actionListener , "3" );
308+ inputManager .addListener (actionListener , "4" );
309+ inputManager .addListener (actionListener , "5" );
310+ inputManager .addListener (actionListener , "6" );
311+ inputManager .addListener (actionListener , "7" );
312+ inputManager .addListener (actionListener , "8" );
313+ inputManager .addListener (actionListener , "-" );
314+
276315 keybindingsText = new BitmapText (assetManager .loadFont ("Interface/Fonts/Default.fnt" ));
277- keybindingsText .setText ("Press 'N' to toggle day/night fade (takes a moment) \n Press 'P' to toggle tri-planar mode" );
316+ keybindingsText .setText ("Press N to toggle day/night fade (takes a moment) \n "
317+ + "Press P to toggle tri-planar mode\n \n "
318+ + "Press - for Final Render (disable debug view)\n "
319+ + "Press 0 for Albedo debug view\n "
320+ + "Press 1 for Normal Map debug view\n "
321+ + "Press 2 for Roughness debug view\n "
322+ + "Press 3 for Metallic debug view\n "
323+ + "Press 4 for Ambient Occlusion (ao) debug view\n "
324+ + "Press 5 for Emissive debug view\n "
325+ + "Press 6 for Exposure debug view\n "
326+ + "Press 7 for Alpha debug view\n "
327+ + "Press 8 for Geoemtry Normals debug view\n " );
328+
278329
279330 getGuiNode ().attachChild (keybindingsText );
280- keybindingsText .move (new Vector3f (200 , 120 , 0 ));
331+ keybindingsText .move (new Vector3f (5 , cam . getHeight () * 0.995f , 0 ));
281332 }
282333
283334 @ Override
0 commit comments