@@ -189,6 +189,20 @@ public void onAction(String name, boolean pressed, float tpf) {
189189 isNight = !isNight ;
190190 // Ambient and directional light are faded smoothly in update loop below.
191191 }
192+
193+ if (name .length () == 1 && !pressed ){
194+ if (name .equals ("-" )){
195+ matTerrain .setInt ("DebugValuesMode" , -1 );
196+ }else {
197+ try {
198+ int debugValueMode = Integer .parseInt (name );
199+ matTerrain .setInt ("DebugValuesMode" , debugValueMode );
200+ }
201+ catch (Exception e ){
202+
203+ }
204+ }
205+ }
192206 }
193207 };
194208
@@ -364,16 +378,51 @@ private void setupKeys() {
364378 inputManager .addMapping ("triPlanar" , new KeyTrigger (KeyInput .KEY_P ));
365379 inputManager .addMapping ("toggleNight" , new KeyTrigger (KeyInput .KEY_N ));
366380
381+ inputManager .addMapping ("0" , new KeyTrigger (KeyInput .KEY_0 )); // toggleDebugModeForAlbedo
382+ inputManager .addMapping ("1" , new KeyTrigger (KeyInput .KEY_1 )); // toggleDebugModeForNormalMap
383+ inputManager .addMapping ("2" , new KeyTrigger (KeyInput .KEY_2 )); // toggleDebugModeForRoughness
384+ inputManager .addMapping ("3" , new KeyTrigger (KeyInput .KEY_3 )); // toggleDebugModeForMetallic
385+ inputManager .addMapping ("4" , new KeyTrigger (KeyInput .KEY_4 )); // toggleDebugModeForAo
386+ inputManager .addMapping ("5" , new KeyTrigger (KeyInput .KEY_5 )); // toggleDebugModeForEmissive
387+ inputManager .addMapping ("6" , new KeyTrigger (KeyInput .KEY_6 )); // toggleDebugModeForExposure
388+ inputManager .addMapping ("7" , new KeyTrigger (KeyInput .KEY_7 )); // toggleDebugModeForAlpha
389+ inputManager .addMapping ("8" , new KeyTrigger (KeyInput .KEY_8 )); // toggleDebugModeForGeometryNormals
390+
391+ inputManager .addMapping ("-" , new KeyTrigger (KeyInput .KEY_MINUS )); // - key will disable dbug mode
392+
367393 inputManager .addListener (actionListener , "triPlanar" );
368394 inputManager .addListener (actionListener , "toggleNight" );
369395
396+ inputManager .addListener (actionListener , "0" );
397+ inputManager .addListener (actionListener , "1" );
398+ inputManager .addListener (actionListener , "2" );
399+ inputManager .addListener (actionListener , "3" );
400+ inputManager .addListener (actionListener , "4" );
401+ inputManager .addListener (actionListener , "5" );
402+ inputManager .addListener (actionListener , "6" );
403+ inputManager .addListener (actionListener , "7" );
404+ inputManager .addListener (actionListener , "8" );
405+ inputManager .addListener (actionListener , "-" );
406+
370407 keybindingsText = new BitmapText (assetManager .loadFont ("Interface/Fonts/Default.fnt" ));
371- keybindingsText .setText ("Press 'N' to toggle day/night fade (takes a moment) \n Press 'P' to toggle tri-planar mode" );
408+ keybindingsText .setText ("Press N to toggle day/night fade (takes a moment) \n "
409+ + "Press P to toggle tri-planar mode\n \n "
410+ + "Press - for Final Render (disable debug view)\n "
411+ + "Press 0 for Albedo debug view\n "
412+ + "Press 1 for Normal Map debug view\n "
413+ + "Press 2 for Roughness debug view\n "
414+ + "Press 3 for Metallic debug view\n "
415+ + "Press 4 for Ambient Occlusion (ao) debug view\n "
416+ + "Press 5 for Emissive debug view\n "
417+ + "Press 6 for Exposure debug view\n "
418+ + "Press 7 for Alpha debug view\n "
419+ + "Press 8 for Geoemtry Normals debug view\n " );
420+
372421
373422 getGuiNode ().attachChild (keybindingsText );
374423 keybindingsText .move (new Vector3f (200 , 120 , 0 ));
424+ keybindingsText .move (new Vector3f (5 , cam .getHeight () * 0.995f , 0 ));
375425 }
376-
377426 @ Override
378427 public void simpleUpdate (float tpf ) {
379428 super .simpleUpdate (tpf );
0 commit comments