This commit is contained in:
ZappoMan 2015-06-17 09:23:12 -07:00
parent ea98581d22
commit 0e18c75b0b
4 changed files with 11 additions and 13 deletions

View file

@ -51,7 +51,7 @@ uniform vec3 v3LightPos;
uniform float g;
uniform float g2;
varying vec3 myPosition;
varying vec3 position;
float scale(float fCos)
@ -64,7 +64,7 @@ float scale(float fCos)
void main (void)
{
// Get the ray from the camera to the vertex, and its length (which is the far point of the ray passing through the atmosphere)
vec3 v3Pos = myPosition;
vec3 v3Pos = position;
vec3 v3Ray = v3Pos - v3CameraPos;
float fFar = length(v3Ray);
v3Ray /= fFar;

View file

@ -53,18 +53,16 @@ uniform float fScaleOverScaleDepth; // fScale / fScaleDepth
const int nSamples = 2;
const float fSamples = 2.0;
varying vec3 myPosition;
varying vec3 position;
void main(void)
{
// Get the ray from the camera to the vertex, and its length (which is the far point of the ray passing through the atmosphere)
myPosition = gl_Vertex.xyz * fOuterRadius;
position = gl_Vertex.xyz * fOuterRadius;
//gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1.0);
// standard transform
TransformCamera cam = getTransformCamera();
TransformObject obj = getTransformObject();
vec4 v4pos = vec4(myPosition, 1.0);
vec4 v4pos = vec4(position, 1.0);
<$transformModelToClipPos(cam, obj, v4pos, gl_Position)$>
}

View file

@ -53,7 +53,7 @@ uniform float g2;
const int nSamples = 2;
const float fSamples = 2.0;
varying vec3 myPosition;
varying vec3 position;
float scale(float fCos)
{
@ -65,7 +65,7 @@ float scale(float fCos)
void main (void)
{
// Get the ray from the camera to the vertex and its length (which is the far point of the ray passing through the atmosphere)
vec3 v3Pos = myPosition;
vec3 v3Pos = position;
vec3 v3Ray = v3Pos - v3CameraPos;
float fFar = length(v3Ray);
v3Ray /= fFar;

View file

@ -38,15 +38,15 @@
uniform float fOuterRadius; // The outer (atmosphere) radius
varying vec3 myPosition;
varying vec3 position;
void main(void) {
myPosition = gl_Vertex.xyz * fOuterRadius;
position = gl_Vertex.xyz * fOuterRadius;
// standard transform
TransformCamera cam = getTransformCamera();
TransformObject obj = getTransformObject();
vec4 v4pos = vec4(myPosition, 1.0);
vec4 v4pos = vec4(position, 1.0);
<$transformModelToClipPos(cam, obj, v4pos, gl_Position)$>
}
}