Shaders for Shadows
Shader code for rendering shadows of translucent occluders, soft shadows and single scattering with moment shadow maps.
 All Classes Files Functions Variables Pages
Functions
RandomNumbers.fx File Reference

Go to the source code of this file.

Functions

float GetRandomNumber (uint Seed)
 
float GetRandomNumber (float2 FloatingPointSeed)
 
float GetRandomNumber (float3 FloatingPointSeed)
 
float GetRandomNumber (float4 FloatingPointSeed)
 

Detailed Description

Provides a powerful generator for pseudo-random numbers. Credits for this solution go to Nathan Reed. See http://www.reedbeta.com/blog/2013/01/12/quick-and-easy-gpu-random-numbers-in-d3d11/

Definition in file RandomNumbers.fx.

Function Documentation

float GetRandomNumber ( uint  Seed)

This function generates a random number using the given integer as seed. The returned random number is distributed uniformly within [0.0,1.0).

Warning
It should only be used on shader model 4.0 and above.

Definition at line 10 of file RandomNumbers.fx.

float GetRandomNumber ( float2  FloatingPointSeed)

Like GetRandomNumber(uint) but generates its seed from the given two floating point values and implements a fallback for shader model 1.0 to 3.0.

Definition at line 24 of file RandomNumbers.fx.

float GetRandomNumber ( float3  FloatingPointSeed)

Like GetRandomNumber(uint) but generates its seed from the given three floating point values and implements a fallback for shader model 1.0 to 3.0.

Definition at line 37 of file RandomNumbers.fx.

float GetRandomNumber ( float4  FloatingPointSeed)

Like GetRandomNumber(uint) but generates its seed from the given four floating point values and implements a fallback for shader model 1.0 to 3.0.

Definition at line 50 of file RandomNumbers.fx.