diff options
author | Pasi Keränen <pasi.keranen@qt.io> | 2019-06-06 16:22:02 +0300 |
---|---|---|
committer | Pasi Keränen <pasi.keranen@qt.io> | 2019-06-07 13:52:44 +0300 |
commit | b4954701093739e7a4e54a0669f306922d0d4605 (patch) | |
tree | 73d71319a921234f6b507c9098fdc842f7fe06dc /res/effectlib/perlinNoiseTexture.glsllib | |
parent | 8548a5f5579e3eee7e5ae6b1f6901dcc8bfee19e (diff) |
Long live the slayer!
Initial commit of OpenGL Runtime to repository.
Based on SHA1 61823aaccc6510699a54b34a2fe3f7523dab3b4e
of qt3dstudio repository.
Task-number: QT3DS-3600
Change-Id: Iaeb80237399f0e5656a19ebec9d1ab3a681d8832
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
Diffstat (limited to 'res/effectlib/perlinNoiseTexture.glsllib')
-rw-r--r-- | res/effectlib/perlinNoiseTexture.glsllib | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/res/effectlib/perlinNoiseTexture.glsllib b/res/effectlib/perlinNoiseTexture.glsllib new file mode 100644 index 0000000..d968403 --- /dev/null +++ b/res/effectlib/perlinNoiseTexture.glsllib @@ -0,0 +1,11 @@ +texture_return perlinNoiseTexture( in texture_coordinate_info uvw, in vec3 color1, in vec3 color2, in float size, in bool applyMarble, in bool applyDent + , in float noisePhase, in int noiseLevels, in bool absoluteNoise, in vec3 noiseDistortion + , in float noiseThresholdHigh, in float noiseThresholdLow, in float noiseBands ) +{ + float noise = perlinNoise( uvw.position / size, noisePhase, noiseLevels, noiseDistortion, absoluteNoise + , applyMarble, applyDent, noiseBands, noiseThresholdLow, noiseThresholdHigh ); + texture_return tr; + tr.tint = mix( color1, color2, noise ); + tr.mono = average( tr.tint ); + return( tr ); +} |