Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish modularizing PBRTerrain.j3md #2369

Closed
wants to merge 8 commits into from
Closed

Conversation

yaRnMcDonuts
Copy link
Member

Previously I only modularized AdvnacedPBRTerrain.j3md

But now this PR applies the same concept to PBRTerrain.j3md

I ended up deleting the PBRTerrain.frag file, so now both of the terrain's .j3md files reference the same fragment shader, but the advanced version has a boolean called UseTextureArrays set to true to tell the fragment shader to read from texture arrays instead of normal textures.

I also added suppor for metallicRoughnessAoEi maps in the regular PRRTerrain shader (Ao being ambient occlusion that is packed in blue channel, and Ei being emissiv intensity which gets packed in the alpha channel). You will still be limited to 16 textures without using texture arrays, and as always I'd suggest most people juts use the advanced version of the shader primarily, but atleast the option is there.

Previously I only modularized AdvnacedPBRTerrain.j3md

But now this PR applies the same concept to PBRTerrain.j3md

I ended up deleting the PBRTerrain.frag file, so now both of the terrain's .j3md files reference the same fragment shader, but the advanced version has a boolean called UseTextureArrays set to true to tell the fragment shader to read from texture arrays instead of normal textures.

I also added suppor for metallicRoughnessAoEi maps in the regular PRRTerrain shader (Ao being ambient occlusion that is packed in blue channel, and Ei being emissiv intensity which gets packed in the alpha channel). You will still be limited to 16 textures without using texture arrays, and as always I'd suggest most people juts use the advanced version of the shader primarily, but atleast the option is there.
@yaRnMcDonuts
Copy link
Member Author

yaRnMcDonuts commented Feb 11, 2025

I made a dumb mistake on my end, and I accidentally made a commit to PBRTerraiUtils.glsllib without making a PR first....

So please also take a look at this commit while reviewing this PR:

5089672

I apologize for this mistake. I'm still learning certain aspects of the github interface, so I'm not sure if there is an easy way to revert a commit. If so, let me know and I'll fix it so that commit is reverted and instead added to this PR.

@stephengold
Copy link
Member

To revert a commit, I'd use the "gitk" tool, not to be confused with "GitKraken".

https://git-scm.com/docs/gitk for more info about "gitk".

Gitk makes reverting a simple procedure. Make sure the relevant branch ("master" in this case) is checked out. Select the commit using the Left Mouse Button, then pull down with the Right Mouse Button and select "Revert This Commit" from the pulldown menu. Then push the branch to "origin".

Or I can do this to 5089672 for you if you'd like.

@yaRnMcDonuts
Copy link
Member Author

yaRnMcDonuts commented Feb 16, 2025

Or I can do this to 5089672 for you if you'd like.

Yes if its not too much of a hassle, that would be helpful.

I looked through the doc you linked but I may be another few days until I'm feeling better from being sick before I get back to working on finishing this PR up and cutting the next release.

@stephengold
Copy link
Member

Sorry to hear you've been ill. I hope you're back to full health very soon.

I reverted 5089672 for you, at 2de6a78 .

@yaRnMcDonuts
Copy link
Member Author

For some reason, my changes that I made to PBRTerrainUtils.glsllib are not showing up... the changes are there in the branch I'm using for this PR, but its not detecting changes when I look at that file compared to jme's master branch. I think I glitched something out wit this PR when I made that one commit directly, so I just went ahead and remade this whole PR: #2377

@yaRnMcDonuts yaRnMcDonuts deleted the yaRnMcDonuts-patch-8 branch February 24, 2025 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants