The ‘readme’ file describes how to use the Converter Utility if you need to convert an existing terrain.
And the repository also contains a working test case if you choose to generate your terrain from code (thanks @Ali_RS for making the test case and helping with testing)
Also thanks to @b00n for your original PBR terrain shader that I based this off of
And thanks to @nehon for creating and sharing the original PBR Shader, bringing JME3 into a new era of graphical quality - and especially for how much I have learned about shaders from analyzing and extending your work with the PBR shaders
Please let me know if you have any issues or questions using the shader or converter utility.
After properly tested by folks and reviewed and final cleanups and being approved by core developers, we might finally be able to include the shader into JME core as a standard PBR terrain material.
the JME version should be more “universal”, or maybe i dont understand what is this plaguedVar, but if im not wrong, its strict related to @yaRnMcDonuts game itself
im not quite sure what are:
livelinessValue
plaguedValue
noiseHash (i belive its some noise, but for now im not sure what noise)
edit:
im not against this vars, but why not make them like “universal overlays” above everything else
Yes, I know about those variables which are specific to Ryan game, of course, they should not get included in the standard one aimed for the core.
I mean there is yet a lot of things to be discussed about it. So no hurry.
Also anyway @yaRnMcDonuts need to change license of it, because it cant be used as new BSD as it is now with license file inside. Strict law related. (“All rights reserved.”)
I will most likely clean up all of the extra (and unused in 3.3) vars for daylight and indoor lighting when 3.3 is moved to stable, but until then I will probably leave support for both so that i can have day/night cycles in 3.2 still
Yeah it should be okay to remove these from the final version if it gets merged into the engine. But for nowm they shouldn’t affect your code as long as they are not defined.
I set that up a long time ago, and actually copy/pasted many things with the license and gradle files from another repository I was referncing, but I’ll remove that licensing. I’m still somewhat of a noob with using Gitbhub
Whenever I was working on it, I was also confused as to why I could not copy this code exactly from the standard PBR shader. But finally I had to just base it off of “what looks right” when the scene is rendered
So rather than basing my code directly on the original shader, I ended up trying many things with the Terrain’s tangents and normals until I finally got the PBR Terrain to appear in the scene the same way as a standard quad with the normal PBR Shader.
Whenever I have some time I’ll test this out and ensure it works as intended when applied to a terrain. Although for a terrain, there would have to be an option to change the intensity on a per-texture basis.
Whenever I have some time I’ll test this out and ensure it works as intended when applied to a terrain. Although for a terrain, there would have to be an option to change the intensity on a per-texture basis.
yes, per texture, it would be again a lot params
it should blend some intensity param based on texture params.
So rather than basing my code directly on the original shader, I ended up trying many things with the Terrain’s tangents and normals until I finally got the PBR Terrain to appear in the scene the same way as a standard quad with the normal PBR Shader.
hmm, would be great to have same as PBR, then it would be easy to “update based on PBR changes” in future. Also probably more issues were solved there.
Thankfully it should not be much of an issue when updating both files to new versions (atleast it was not for me when I was also developing a 3.3 version as well), as most updates to the PBR shader will only effect the lower half of both shaders (the liighting caclulations) wheras the top part of both PBR shaders (the texture reads) is already drastically different between the normal PBR shader and the terrain shader
That’s odd, did you double check that you turned tri-planar mapping on? it looks like the albedo texture is also stretched out as well - I haven’t noticed any distortion in my scenes but I will double check
When using tri-planar mapping, you also need to adjust the scales for all of your textures.
So you need to divide all of your textures’ scales by the size of your terrain, if I remember correctly.
So on a terrain of size 512, a scale of 4.0 is equal to a scale of 0.007797271 in tri-planar mode.
If you make a terrain in the terrain editor, then it will automatically divide/multiply your scales when you toggle tri-planar mode, but you need to do that manually when you make terrains with code.
better now, but im still not sure if normals on 90 degree terrain are ok.
i tried each of
public Vector3f lightDir = new Vector3f(5.9236743f, -7.27054665f, 5.896916f);
public Vector3f lightDir = new Vector3f(5.9236743f, -7.27054665f, -5.896916f);
public Vector3f lightDir = new Vector3f(-4.9236743f, -3.27054665f, 5.896916f);
public Vector3f lightDir = new Vector3f(-4.9236743f, -4.27054665f, -5.896916f);
but always i see very low visible, or invisible normals on same side of mountain. idk why.
They look correct from certain angles - although the issue with normal mapping on all models is that it depends on the lighting angle
If you want to exaggerate the normal map for testing purposes, try settings a low roughness value and a high metallic value. Normal maps are much, much more apparent on PBR models that are very shiney.
If you have a model with high roughness and a low metallic value, then you will notice more depth from the roughness map than the normal map.
all textures have same normalmap, for some reason left arm/hand have almost no normals.
same on front view, same arm/hand
maybe im just nervous about this normals. overall effect is ok, just not sure why its not same on both sides, since it use same texture scale and same normalmaps, just different albedos