I have a procedurally generated terrain and I’m using PBR. I currently am setting the probes position to Vector3f(terrain.localTranslation.x / 2, 50f, terrain.localTranslation.z / 2)
. This should place the probe in the center of the terrain but it would be nice to somehow be able to somehow see it just to verify. I didnt see any functions that looked like it may achieve this task. Something similar to bulletAppState.isDebugEnabled
.
1 Like
So far I have found this Debugging :: jMonkeyEngine Docs. I implemented the SceneProcessor
but the screen is all black. I had to hack a couple things to get the game to not crash.
class WireProcessor(assetManager: AssetManager) : SceneProcessor {
var renderManager: RenderManager? = null
var wireMaterial: Material = Material(assetManager, "/Common/MatDefs/Misc/Unshaded.j3md")
init {
wireMaterial.setColor("Color", ColorRGBA.Blue)
wireMaterial.additionalRenderState.isWireframe = true
}
override fun initialize(rm: RenderManager, vp: ViewPort) {
renderManager = rm
}
override fun reshape(vp: ViewPort, w: Int, h: Int) {
println("reshape")
}
override fun isInitialized(): Boolean {
println("initialize $renderManager")
return renderManager != null
}
override fun preFrame(tpf: Float) {
println("preFrame")
}
override fun postQueue(rq: RenderQueue) {
println("postQueue $renderManager")
renderManager?.setForcedMaterial(wireMaterial)
}
override fun postFrame(out: FrameBuffer) {
println("postFrame $renderManager")
renderManager?.setForcedMaterial(null)
}
override fun cleanup() {
println("cleanup $renderManager")
renderManager?.setForcedMaterial(null)
}
override fun setProfiler(profiler: AppProfiler?) {
}
}
This is how I implemented it
val p = WireProcessor(assetManager)
viewPort.outputFrameBuffer = FrameBuffer(10, 10, 10)
viewPort.outputFrameBuffer.addColorTarget(FrameBuffer.FrameBufferTarget.newTarget(rock))
p.initialize(renderManager, viewPort)
getViewPort().addProcessor(p)
I think you can use
LightsDebugState debugState = new LightsDebugState();
stateManager.attach(debugState);
4 Likes
Thanks I will play around with it. I can see the DirectionalLight
that I added to the scene. Found a but where if the player points the mouse up he can just walk up into the sky, even with gravity set. Trying to get that figured out then I will be coming back.
1 Like
This is definitely what I was looking for thanks.
1 Like