Sparkling material?

Hey Deathrey thanks for providing that material setup, however I couldn’t get it to work appreciably =S

I’ve been moving forward with the Sand material and this is what it looks like now:

https://postimg.org/image/57gwb5ux7/

(Posting pictures is buggy for some reason)

I’ve managed to get the noisy reflections that will shimmer with player movement and look somewhat good, but right now the noise is altogether too high.

It makes it very distracting as large portions of the screen are flickering with movement right now, when the camera is facing any sparkling sand.

Will probably need to figure out a masking solution for those areas of high noise and/or tweak my noise map blending method.

Right now my entire setup revolves around replicating what is described in the presentation ,“Sand Rendering in Journey”.

They derive the sparkles off the sand from blending a noise normal map with the underlying normal map of the sand.

I am using a fake specular Material Function to implement it as PBR setup in Unreal doesn’t seem geared towards achieving this easily.

Currently also working on a terrain system so I can use detail heightmaps as described by them as well.

Hmm, guys I think you went a bit overboard and overthinking on this. I used some of my free time at work to make a material that shimmers nicely, almost like in the Journey. The effect is not overwhelming and I think its well balanced. Here is one video I made demonstration on the sand and the material setup, its nothing special. The two important settings that let me achieve the desired effect are FXAA (TemporalAA works too but the shimmering effect is a bit less) and “Crush Highlights” in PP. Other setting that I changed are Bloom int: 0,5 and that is.

Here is the video: https://www.youtube.com/watch?v=hIXhVYRteC4
The noisy texture I made it in PS using the noise generator and then Bitmap2Material to get it somehow tileable and get strong small features on the roughness texture.
Here are the textures (the wavy normal texture is from internet): http://imgur.com/a/bl3qP

I wrote this in hurry, I hope its informative enough.
Good luck! :slight_smile:

Nice, updates guys. @NasteX, that looks pretty good.

Here’s a updated version of my snow

I still have to give some of the methods mentioned here a try, mine is far from sophisticated and looks nowhere as good as some of the stuff here.

https://youtube.com/watch?v=pSuWH910028

Small critique, fully shadowed areas shouldn’t sparkle because the light source would be occluded.

No doubt. It is there, just did not include it in the vid.
I’ve had a fun time figuring out how to fade the effect in the shadow. Well, self shadow is pretty straight-forward, just dot light vector vs per-pixel normal and fade the effect based off that. Gotta note here that I’ve abandoned any attempts to fake the effect using roughness/specular tweaks since the result was never any close to the references. Additionally, faking dispersion was a must for closeup shots.
While my approach would easily work for surfaces, that are not having other shadows cast on them, the scene I’ve made the material for, was a typical winter pine forest with few buildings and numerous areas of dense shadows.
Suppressing the effect there turned out to be a major pain.
I think I’ve ran through every possible trick I could imagine, but my solution actually came from game mechanics, that required to determine if the player was in the shadow and doing player’s material change effect based on that. There already was an additional low res render target storing depth from directional light just around the player(additional shadow map basically). I’ve used that one in snow material to mask off the effect. Due to low res of the render target, the effect was still bleeding into the shadows occasionally, but nothing that would fall beyond acceptable.

Whole method is too expensive to be used elsewhere.

@Deathrey, absolutely beautiful. You guys are like magicians. It would be absolutely perfect without the sparkling in the shadow as you guys have mentioned.

Has much changed in the material since your post #20?

The method of generating speckles is the same, but emissive is used in this preview instead of relying on rotated normals to reflect the light.

I played a little bit more with the material and tested some fake speculars solutions on the nett.

https://www.youtube.com/watch?v=uY4DLd-9w4k

@Nastex , pretty cool. Is the sparkle minimized in shadows?

Not much, but I think to take a look on that next week when I get a little bit free time. :wink:

I just took a close look to this effect in Battlefront 3. It’s done differently for sand and snow. Their snow looks like something similar to what Deathrey has done (sorta blinking glowing dots) while the sand is a very noisy roughness map that seems to have a panning mask overlayed on it to constantly make the shiny spots blinking (while the camera is on the move) which ends up quite cheap in terms of cost.

Hey guys!

It’s been a while, and here’s my progress with the sand!

Adding a lightmapping feature that allows for the dramatic contrast in dunes that Unreals PBR just wont give you, really makes a difference in the total outcome!

Hey guys,

You may want to take a look at the new automotive car paint pack available for free on the market place. I did some experimentation in there for sparkles on car paint. It was actually harder to make very subtle and even sparkles, but the kind of larger sparkles you guys seem to want in this thread were pretty doable. The one thing that makes them tricky is Temporal AA. Going with FXAA or higher screen percentage works better with sparkles if you can manage it.

The nice thing about how its done in the car materials is that the bottom normal that creates the sparkles is actually responding to the reflection environment and shadows etc so you wouldn’t need to rely on manual cubemaps in your shaders. You would have to use the clear coat shading model and enable the bottom clear coat normal but you should be able to use clear coat materials and specify the clear coat alpha to be 0 and it should work decently. Of course the diffuse term may need to be modified but if thats an issue I can point out how.

The other thing I messed with to help was scaling the sparkle normal texture with distance using a function called ‘infinite scale blending’. It works ok, the idea is to make the sparkles still show up in the distance by ‘leapfrogging’ the texture scale. So by using only 2 texture lookups it can continually scale up the UVs so they seem more ‘screen space’ sized but still world attached. I was planning to add bilinear filtering to it but didn’t get around to it. Should be fairly simple to add.

we approached the issue of masking sparkly snow using a post-process. disclaimer - everything still in prototype stage and more tweaking necessary

https://dl.dropboxusercontent.com/u/107682595/Unreal/SparklingSnow.gif

by reserving the specular material value of 1 for any surface that should sparkle it was fairly easy to specify snow areas.
we used a tweaked version of the lit screen buffer to create a mask for any brightly lit areas and combining those two masks we got the sparkle only where we wanted it.

obviously quite specific to our use case and definitely not fit for every project, but maybe some of you can make use of it.

fff255adddf015cd0351f3305a82da4291b5c2b1.jpeg

cfc3d3d0ebebc9fb0c84a0fe30aabc627b1dc148.jpeg

Nice Job!!!

Sorry to necro this thread but i found a paper with a very good solution here : https://hal.inria.fr/hal-01327604/file/sparkle.pdf