The pic is used material. I am thinking can screen filter make is?
Material mat = new Material(assetManager, "Common/MatDefs/Misc/ShowNormals.j3md");
Spatial scene = scene.clone();
scene.setMaterial(mat);
rootNode.attachChild(scene);
The pic is used material. I am thinking can screen filter make is?
Material mat = new Material(assetManager, "Common/MatDefs/Misc/ShowNormals.j3md");
Spatial scene = scene.clone();
scene.setMaterial(mat);
rootNode.attachChild(scene);
As far as I remember, filters uses only rendered scene and/or zbuffer as the input textures. They perform operations using only image data, not geometry data. If you want to have access to object’s normal map you need to write some custom Render processor which will render scene’s normals to separate viewport. Creating viewport you need to add the color texture to it. The same texture will have all your normal data painted on it.
Some filters like SSAO and Cartoon edge use screen space normals in viewspace.
For this they use a technique in lighting.j3md called PreNormalPass that does render normal to screen.
see this code in SSAOFilter
I hava tried it. But the color is related to camera direction, not I want. I tried to calculate from PreNormal(color will change when rotate camera) to WorldNormal(stable color)in frag, but I failed.
Well it could help to post your shader code so we could tell what you did wrong, because IMO that’s the right approach
How can I get world normal color (not screen normal) in filter shader ?
TransformWorldNormal(normal) instead of TransformNormal(normal)
Thanks!