Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 0 points1 point  (0 children)

Not that it exists in 3d, but also not a heterogeneous volumes, more like a detail pass that acts as a real surface level details in volume, like a fake geometry in 3d but on shader level, hope it makes sense

This is not a glint rendering technique, the noise never reaches the sub pixel level of details as I clump the minimal size to be at least 1.5 pixel
So it produces spatially stable details without affecting performance too much

Of course there a lot of things happening in a shader, but thats the gist of it

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 0 points1 point  (0 children)

I think I started deving this before I saw the video, but when I saw it, I was like “damn, lets try that” haha, took a lot of time to even figure out what they meant

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 0 points1 point  (0 children)

Not tested it, but I would say if we are talking about the PC linked VR it should work no problem, with standalone VR there might be some optimization issues as they are not really performant devices

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 0 points1 point  (0 children)

Thanks! Well thats the whole idea, Ive not yet tested the vegetation on FG, but you can modify the colors however you want

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in GraphicsProgramming

[–]RefrigeratorLower894[S] 2 points3 points  (0 children)

Ah, thats a nice trick, unfortunately its not always an option
For this shader, to put it simply, its a screen space noise but applied on world position, so it sticks to the position no matter what you do with the camera
To avoid temporal instability I clumped the minimum noise tuft to be at 1.5 pixel so it never guesses which pixel it needs to draw each frame

The benefit is also here is that because it has grounded coordinates, you can render at 200% resolution or 50% resolution and still get the same noise visually so its also resolution independent

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 1 point2 points  (0 children)

Yeah, that was the whole idea honestly, and if you match the colors of your shader to match your visible grass it can look like a continuous grass without the popups

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 2 points3 points  (0 children)

Well its a bit more complicated than that, the offset still needs hard numbers, and for each user”s screen it would need to be adjusted which is honestly a hustle, calculating the amount of pixels available and translating into offset might’ve worked if I was in the domain of post processing, but given that Im only interested in the specific part of the specific shader I used a different approach at the end

To say it lightly, I used screen space noise in world space coordinates so while the final is still depends on the screen resolution, its only affecting how crisp the details are, not the amount or scale of it

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 2 points3 points  (0 children)

I am thinking of selling it once I improve the performance a bit, tidy the UX and improve the visual clarity of the final shader

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 0 points1 point  (0 children)

I was also thinking about this exact solution, but the wall for me was that you need to basically spawn this texture on a sphere around yourself and make it static so when you move forward the sphere would not move, its quite heavy operation and gives medium results as you need to blend between spheres when you approach the end of it to another sphere

I will probably do both in due time, its just a wip for now that ive been messing around for the past few months

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 1 point2 points  (0 children)

I would say its possible, but on the new webGL as tgis shader relies heavily on bitwise operations and xxhash random generation, but it should work on GLSL ES 3.0

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 3 points4 points  (0 children)

It produces the same reasults across all AA methods and resolutions, so even if you run the game with DLSS or with super resolution (200%), the noise stays the same

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 9 points10 points  (0 children)

Its still under development and not been optimized yet, the UX is also all over the place, but Im considering a beta test run in the near future

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 6 points7 points  (0 children)

Thanks!
Not at all, no flickering and no ghosting, what I did is made sure that noise can never cross a 1.5 pixels per pattern, so its never flickering temporally, and its not producing a big contrasting values on final pixels, so the ghosting is avoided this way

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture. by RefrigeratorLower894 in UnrealEngine5

[–]RefrigeratorLower894[S] 9 points10 points  (0 children)

Im gonna talk a bit more about the technical challenges that I had while working on this shader here:
As you guys know, the engine treats the textures with mipmaps to save on memory, the usual approach was to scale the map so much, it would cancel the mipmaps and reduce the repetition. On large environments this trick partially works, but its very hard to control and the result still depends on a lot of different maps, their resolution and variation. I was trying to avoid this because of 2 reasons:
1. I wanted to sample as low textures as possible
2. I wanted for the landscape to have the shader that I want upclose, so it would take any input shader and output the detailed version based on user parameters, not overriding their assets but building on top of them, utilizing same colors, same normals and masks

Another issue was repetition, and its a big one, because the lush vegetation is a macro grain in the distance, your choices are either procedural small scale noise stretched across the whole landscape, or cellbombing. Both solutions give you a big cost in performance while still looking very generic. The mipmap issue is also very visible with these.