Skip to content

Commit

Permalink
Merge branch 'feature-64' of github.com:obviousjim/CLOUDS into featur…
Browse files Browse the repository at this point in the history
…e-64
  • Loading branch information
obviousjim committed May 27, 2014
2 parents 7b7a70f + 3fc332e commit 284f00f
Show file tree
Hide file tree
Showing 9 changed files with 412 additions and 123 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ uniform vec4 edgeColor;
uniform vec4 fillColor;
uniform vec4 specularColor;

uniform vec4 groundColor = vec4( .4, 1., .6, 1.);
uniform vec4 undergroundColor = vec4( .6 ,.2, .1, 1.);
uniform vec4 groundColor;// = vec4( .4, 1., .6, 1.);
uniform vec4 undergroundColor;// = vec4( .6 ,.2, .1, 1.);
uniform vec4 cloudShadowColor;
uniform float cloudShadow;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ varying float isGround;
varying float isCloud;

varying vec4 groundSample;
uniform float groundDrama = .75;
uniform float groundDrama;// = .75;

uniform float cloudThreshold = .55;
uniform float cloudHeight = 4.;
uniform float cloudThickness = 8.;
uniform float cloudThreshold;// = .55;
uniform float cloudHeight;// = 4.;
uniform float cloudThickness;// = 8.;


uniform vec3 noiseOffset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
uniform vec3 cameraPos;
uniform float cameraCutoffDistance;

uniform float cloudThreshold = .55;
uniform float cloudHeight = 0.;
uniform float cloudThickness = 8.;
uniform float cloudThreshold;// = .55;
uniform float cloudHeight;// = 0.;
uniform float cloudThickness;// = 8.;

uniform vec3 noiseOffset;
uniform vec3 cameraOffset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ uniform vec4 fogColor;
uniform float useFog;

uniform float groundDrama;
uniform float maxHeight = 10.;
uniform float maxHeight;// = 10.;

uniform vec4 groundColor = vec4( .4, 1., .6, 1.);
uniform vec4 undergroundColor = vec4( .6 ,.2, .1, 1.);
uniform vec4 groundColor;// = vec4( .4, 1., .6, 1.);
uniform vec4 undergroundColor;// = vec4( .6 ,.2, .1, 1.);
uniform vec4 cloudShadowColor;
uniform float cloudShadow;

Expand Down
12 changes: 6 additions & 6 deletions CloudsData/visualsystems/CubeCraft/shaders/mineCraftGround.vert
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
#version 120
#extension GL_ARB_texture_rectangle : enable

uniform float groundDrama = .75;
uniform float groundDrama;// = .75;

uniform float cloudThreshold = .55;
uniform float cloudHeight = 4.;
uniform float cloudThickness = 8.;
uniform float cloudThreshold;// = .55;
uniform float cloudHeight;// = 4.;
uniform float cloudThickness;// = 8.;

uniform vec3 cubeScale = vec3(1.,1.,1.);
uniform vec3 cubeScale;// = vec3(1.,1.,1.);

uniform vec3 cameraPos;
uniform float cameraCutoffDistance;

uniform vec3 noiseOffset;
uniform vec3 cameraOffset;

uniform float maxHeight = 10.;
uniform float maxHeight;// = 10.;


uniform float fogDist;
Expand Down
4 changes: 2 additions & 2 deletions CloudsData/visualsystems/CubeCraft/shaders/voxelShader.frag
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ uniform float fogExpo;

uniform float edgeSmoothing;
uniform vec4 edgeColor;
uniform vec4 fillColor = vec4(0., 1.,1.,1.);
uniform vec4 specularColor = vec4( 1., 1.,0.,1.);
uniform vec4 fillColor;// = vec4(0., 1.,1.,1.);
uniform vec4 specularColor;// = vec4( 1., 1.,0.,1.);

uniform float specExpo;
uniform float specScale;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ void CloudsVisualSystemCubeCraft::selfSetDefaults()

primaryCursorMode = CURSOR_MODE_CAMERA;
secondaryCursorMode = CURSOR_MODE_INACTIVE;

cullDirection = GL_FRONT; // GL_BACK; // GL_NONE;
}

void CloudsVisualSystemCubeCraft::selfSetup()
Expand Down Expand Up @@ -395,7 +397,7 @@ void CloudsVisualSystemCubeCraft::drawVoxelGrid()
ofDisableAlphaBlending();

glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glCullFace(cullDirection);

float scale = 30.;
ofPushMatrix();
Expand Down Expand Up @@ -457,7 +459,7 @@ void CloudsVisualSystemCubeCraft::drawCubeCraft()
ofDisableAlphaBlending();

glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glCullFace(cullDirection);

float scale = 30.;
ofPushMatrix();
Expand All @@ -466,6 +468,7 @@ void CloudsVisualSystemCubeCraft::drawCubeCraft()
mineCraftGroundShader.begin();

mineCraftGroundShader.begin();
mineCraftGroundShader.setUniform1f("maxHeight", 10);
mineCraftGroundShader.setUniform1f("cameraCutoffDistance", 3);

mineCraftGroundShader.setUniform1f("specExpo", specExpo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,6 @@ class CloudsVisualSystemCubeCraft : public CloudsVisualSystem {
ofFloatColor fc;

int mineCraftDimX, mineCraftDimY;

GLenum cullDirection;
};
486 changes: 385 additions & 101 deletions VSCubeCraft/VSCubeCraft.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

0 comments on commit 284f00f

Please sign in to comment.