October 29, 2013

HLSL noise effect for UDK

Sometimes we need to have the noise effect inside our shaders. Unfortunately it can be not a trivial task in some cases.

For my FFT-based ocean shader I used the solution that I've found on Stack Overflow (thanks, Michael!).

I'll dublicate it here to save the solution:


To understand how this works if we break the formula down into its constituent parts it becomes easier to visualize what is going on:


Paste the above into: https://www.shadertoy.com/new

It can be simply used for materials in UDK. You just need to create a custom HLSL node:

Noise effect as simple post-effect

It's a fast example how this trick can be used. But it will be better to use it in the material of particular mesh rather than post effect! Use UVs as p param and it'll be cool.

Captured screens with different noise scale:

Z.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.