@ReceiveEvent(components = ClientComponent.class) public void onHideHUD(HideHUDButton event, EntityRef entity) { if (event.isDown()) { // Make sure both are either visible or hidden final boolean hide = !(config.getRendering().getDebug().isHudHidden() && config.getRendering().getDebug().isFirstPersonElementsHidden()); config.getRendering().getDebug().setFirstPersonElementsHidden(hide); config.getRendering().getDebug().setHudHidden(hide); event.consume(); } }
@Override public Boolean get() { return !context.get(Config.class).getRendering().getDebug().isHudHidden(); } });
if (config.getDebug().isEnabled()) { try { ContextAttribs ctxAttribs = new ContextAttribs().withDebug(true);
switch (event.getKey().getId()) { case Keyboard.KeyId.F6: config.getRendering().getDebug().setEnabled(!config.getRendering().getDebug().isEnabled()); event.consume(); break; case Keyboard.KeyId.F8: config.getRendering().getDebug().setRenderChunkBoundingBoxes(!config.getRendering().getDebug().isRenderChunkBoundingBoxes()); event.consume(); break; case Keyboard.KeyId.F9: config.getRendering().getDebug().setWireframe(!config.getRendering().getDebug().isWireframe()); event.consume(); break;
public OverlaysNode(String nodeUri, Context context) { super(nodeUri, context); componentSystemManager = context.get(ComponentSystemManager.class); worldRenderer = context.get(WorldRenderer.class); SubmersibleCamera playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); addDesiredStateChange(new BindFbo(context.get(DisplayResolutionDependentFBOs.class).getGBufferPair().getLastUpdatedFbo())); addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL_URN)); }
public OpaqueObjectsNode(String nodeUri, Context context) { super(nodeUri, context); componentSystemManager = context.get(ComponentSystemManager.class); worldRenderer = context.get(WorldRenderer.class); Camera playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); // IF wireframe is enabled the WireframeTrigger will remove the face culling state change // from the set of desired state changes. // The alternative would have been to check here first if wireframe mode is enabled and *if not* // add the face culling state change. However, if wireframe *is* enabled, the WireframeTrigger // would attempt to remove the face culling state even though it isn't there, relying on the // quiet behaviour of Set.remove(nonExistentItem). We therefore favored the first solution. faceCullingStateChange = new EnableFaceCulling(); addDesiredStateChange(faceCullingStateChange); wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); addDesiredStateChange(new BindFbo(context.get(DisplayResolutionDependentFBOs.class).getGBufferPair().getLastUpdatedFbo())); }
@Override public void renderOverlay() { if (config.getRendering().getDebug().isRenderSkeletons()) { glDisable(GL_DEPTH_TEST); Vector3f cameraPosition = worldRenderer.getActiveCamera().getPosition();
public BackdropNode(String nodeUri, Context context) { super(nodeUri, context); backdropProvider = context.get(BackdropProvider.class); worldRenderer = context.get(WorldRenderer.class); SubmersibleCamera activeCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThroughNormalized(activeCamera)); initSkysphere(activeCamera.getzFar() < RADIUS ? activeCamera.getzFar() : RADIUS); wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); FBO lastUpdatedGBuffer = displayResolutionDependentFBOs.getGBufferPair().getLastUpdatedFbo(); addDesiredStateChange(new BindFbo(lastUpdatedGBuffer)); addDesiredStateChange(new SetFboWriteMask(lastUpdatedGBuffer, true, false, false)); addDesiredStateChange(new EnableMaterial(SKY_MATERIAL_URN)); // By disabling the writing to the depth buffer the sky will always have a depth value // set by the latest glClear statement. addDesiredStateChange(new DisableDepthWriting()); // Note: culling GL_FRONT polygons is necessary as we are inside the sphere and // due to vertex ordering the polygons we do see are the GL_BACK ones. addDesiredStateChange(new EnableFaceCulling()); addDesiredStateChange(new SetFacesToCull(GL_FRONT)); skyMaterial = getMaterial(SKY_MATERIAL_URN); int textureSlot = 0; addDesiredStateChange(new SetInputTexture2D(textureSlot++, "engine:sky90", SKY_MATERIAL_URN, "texSky90")); addDesiredStateChange(new SetInputTexture2D(textureSlot, "engine:sky180", SKY_MATERIAL_URN, "texSky180")); }
RenderingDebugConfig renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this);
renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this);