Geometry and Compute Shaders

Looking amazing!

2 Likes

pixel porn, droolā€¦

3 Likes

i agree its amazing :slight_smile:

just imagine all reflections with dynamic clouds/etc (including PBR idea - @danielp have you tried?)

not sure why you had 14 fps there tho, but probably you minimized/unfocused(that pause render) thats why.

Also im not sure how much fps difference is in 2 framebuffers vs 1 framebuffer here(or what you mean by half frame buffer). if its not much, then current approach could be ok, i hope you agree.

1 Like

Havenā€™t tried with PBR yet - I think Iā€™ll give it a shot in the next day or two. :smiley:

1 Like

The performance is poor because itā€™s rendering at full resolution. I need to render the sky/clouds to the half sized frame buffer and then apply that texture to a dome geometry.

1 Like

Working on integrating this into my project now - anyone else having issues with the DDS loader?

Iā€™m seeing the following new lines in my startup log:

Mar 14, 2020 5:19:09 PM com.jme3.material.plugins.J3MLoader readDefine
WARNING: In technique 'Default':
Define 'HDR_ENABLED' mapped to non-existent material parameter 'HDR', ignoring.
Mar 14, 2020 5:19:09 PM com.jme3.texture.plugins.DDSLoader readPixelFormat
WARNING: Expected size = 512, real = 65,536
Mar 14, 2020 5:19:09 PM com.jme3.texture.plugins.DDSLoader readPixelFormat
WARNING: Expected size = 128, real = 4,096

The sky colors look great but I have no clouds. VCloud setup is copied directly from the demo app in the VCloud repo.

The HDR_ENABLED flag is in one of the .j3md filesā€¦ it can safely be removed to get around that warning. Not sure why the other two texture warnings happen, but I get them too. I debugged and it looks like it does set the texture sizes correctly after the warning. Maybe someone with more knowledge of the DDS loader can explain.

As to why the clouds donā€™t show, thatā€™s kind of hard to say. Triple check that everything is the same between the repo and your project. There is probably something off somewhere. Are you using jme 3.2?

Warnings Iā€™m not worried about if there are no adverse affects.

Iā€™m on 3.3.0-beta1 - everything else seems fine. Iā€™d suspect an issue in my setup over the engine version. Unfortunately running on 3.2 isnā€™t an option due to some dependencies on 3.3 PBR methods.

i also receive the same:

WARNING: In technique ā€˜Defaultā€™:
Define ā€˜HDR_ENABLEDā€™ mapped to non-existent material parameter ā€˜HDRā€™, ignoring.
mar 15, 2020 12:27:51 PM com.jme3.texture.plugins.DDSLoader readPixelFormat
WARNING: Expected size = 512, real = 65 536
mar 15, 2020 12:27:51 PM com.jme3.texture.plugins.DDSLoader readPixelFormat
WARNING: Expected size = 128, real = 4 096

but clouds work as expected.

do you use LWJGL3?

i think something else make issue here.

My atmosphere lib projects a flat texture onto a dome. The code is on git. Here are the vert/frag shaders.

https://github.com/jayfella/jme-atmosphere/blob/master/src/main/resources/MatDefs/Clouds/NoiseClouds.vert

https://github.com/jayfella/jme-atmosphere/blob/master/src/main/resources/MatDefs/Clouds/NoiseClouds.frag

Yes, this is running on LWJGL 3.

Thanks for the reply @jayfella. This issue is the texture is generated on the framebuffer in screen space, so I am not just projecting a flat texture across the sky. It has to be projected onto the dome using screen space coordinates (I think) and I canā€™t seem to get it exactly right. I have the exact same code for gl_Position, I just need to figure out the right way to sample the texture in the frag shader.

Edit: I figured it out. I was making it harder than it needed to be. It was just fragCoord/resolution.
As it turns out, this renders the sky correctly, but this solution wonā€™t work as the reflection does not work correctly now. Oh well. I will have to find a way to optimize the dome solution alone.

The issue was the cloud coverage parameter - 0.25f was too small. Using 0.75f as the demo does works fine. Looks great!

1 Like

so clouds are working now for you?

even with 0.25 i seen some cloudsā€¦ so i wonder why not you :slight_smile:

1 Like

Yep! Itā€™s working like a charm!

I may have missed some - I didnā€™t do a full horizon - horizon overhead pan (camera controls in my project are a bit funky at the moment).

1 Like

@dreamwagon ?

just curious if there is some progress update you can share :slight_smile:

1 Like

Yes! I have lots of updates to push, but just waiting for a couple more things. Should be (relatively) soon!

3 Likes

Any updates? Looking forward to seeing your progress!

1 Like

I used CS shader in another engine to calculate visibility field for x-com like game prototype. So it might be useful.

:pleading_face: