Permalink
Browse files

Expose parameters in woods and remnant_x.

  • Loading branch information...
jimbo00000 committed Feb 1, 2015
1 parent 6380ba0 commit 8081aeb2504382f42744c284b8263cd3b0521eb0
Showing with 21 additions and 11 deletions.
  1. +9 −5 shaders/remnant_x.glsl
  2. +12 −6 shaders/woods.glsl
@@ -15,17 +15,21 @@
vec3 sunDir = normalize( vec3( 0.35, 0.1, 0.3 ) );
const vec3 sunColour = vec3(1.0, .95, .8);
// @var float SCALE 2.8 0.5 4.0 0.004
// @var vec3 surfaceColour2 .4 .4 .5 color
// @var vec3 surfaceColour3 .5 .3 0. color
// @var vec3 fogCol .4 .4 .4 color
uniform float SCALE; // 2.8
uniform vec3 surfaceColour2;// = vec3(.4, .4, 0.5);
uniform vec3 surfaceColour3;// = vec3(.5, 0.3, 0.00);
uniform vec3 fogCol;// = vec3(0.4, 0.4, 0.4);
#define SCALE 2.8
vec3 surfaceColour1 = vec3(.8, .0, 0.);
#define MINRAD2 .25
float minRad2 = clamp(MINRAD2, 1.0e-9, 1.0);
vec4 scale = vec4(SCALE, SCALE, SCALE, abs(SCALE)) / minRad2;
float absScalem1 = abs(SCALE - 1.0);
float AbsScaleRaisedTo1mIters = pow(abs(SCALE), float(1-10));
vec3 surfaceColour1 = vec3(.8, .0, 0.);
vec3 surfaceColour2 = vec3(.4, .4, 0.5);
vec3 surfaceColour3 = vec3(.5, 0.3, 0.00);
vec3 fogCol = vec3(0.4, 0.4, 0.4);
float gTime = 15.;
//----------------------------------------------------------------------------------------
@@ -14,6 +14,16 @@
// @var tex2 tex09.jpg
// @var tex3 tex07.jpg
// @var float mushSca 2.0 0.1 5.0 0.1
// @var float mushSpeed 0.5 0.05 5.0 0.05
// @var float mushAmpl 0.1 0.0 0.5 0.01
// @var float chsca 0.2 0.0 0.5 0.01
uniform float mushSca; // = 2.0;
uniform float mushSpeed; // =0.5
uniform float mushAmpl; // =0.1
uniform float chsca; // = 0.2;
#define LIGHTRIG 1 // 0 or 1
//#define GODRAYS
//#define HIGH_QUALITY_NOISE
@@ -131,7 +141,6 @@ vec3 texturize( sampler2D sa, vec3 p, vec3 n )
float treeBase( vec2 pos )
{
float chsca = 0.2;
vec2 chos = fract(chsca*pos) - 0.5;
return length( chos );
}
@@ -155,11 +164,11 @@ vec2 grassDistr( in vec2 pos )
float mushroomAnim( float t )
{
float f = sin( 0.5*t );
float f = sin( mushSpeed*t );
f = -1.0 + 2.0*smoothstep( 0.45, 0.55, 0.5 + 0.5*f );
return 1.0 + 0.1*f;
return 1.0 + mushAmpl*f;
}
float map( in vec3 pos, out vec4 suvw, out float info )
@@ -183,7 +192,6 @@ float map( in vec3 pos, out vec4 suvw, out float info )
// mushroom position
float mushSca = 2.0;
vec2 mushWPos = (0.5+floor(mushSca*pos.xz))/mushSca;
vec3 mushPos = vec3( fract(mushSca*pos.x)-0.5, mushSca*(pos.y-h), fract(mushSca*pos.z)-0.5 );
float mushID = hash( floor(mushSca*pos.xz) );
@@ -198,7 +206,6 @@ float map( in vec3 pos, out vec4 suvw, out float info )
//-----------------------------
// trees
{
float chsca = 0.2;
vec3 chos = vec3( fract(chsca*pos.x)-0.5, chsca*(pos.y-h), fract(chsca*pos.z)-0.5 );
float y = chos.y;
float r = length( chos.xz );
@@ -277,7 +284,6 @@ float map2( in vec3 pos )
//-----------------------------
// trees
{
float chsca = 0.2;
vec3 chos = vec3( fract(chsca*pos.x)-0.5, chsca*(pos.y-h), fract(chsca*pos.z)-0.5 );
float y = chos.y;
float r = length( chos.xz );

0 comments on commit 8081aeb

Please sign in to comment.