Merge pull request #1444 from rextimmy/scattersky_fix

Seems good
This commit is contained in:
Areloch 2015-10-19 19:07:25 -05:00
commit 0f8d4d30ab
6 changed files with 2 additions and 35 deletions

View file

@ -82,13 +82,6 @@ const F32 ScatterSky::smEarthRadius = (6378.0f * 1000.0f);
const F32 ScatterSky::smAtmosphereRadius = 200000.0f; const F32 ScatterSky::smAtmosphereRadius = 200000.0f;
const F32 ScatterSky::smViewerHeight = 1.0f; const F32 ScatterSky::smViewerHeight = 1.0f;
GFXImplementVertexFormat( ScatterSkyVertex )
{
addElement( "POSITION", GFXDeclType_Float3 );
addElement( "NORMAL", GFXDeclType_Float3 );
addElement( "COLOR", GFXDeclType_Color );
}
ScatterSky::ScatterSky() ScatterSky::ScatterSky()
{ {
mPrimCount = 0; mPrimCount = 0;
@ -761,7 +754,7 @@ void ScatterSky::_initVBIB()
F32 zOffset = -( mCos( mSqrt( 1.0f ) ) + 0.01f ); F32 zOffset = -( mCos( mSqrt( 1.0f ) ) + 0.01f );
mVB.set( GFX, mVertCount, GFXBufferTypeStatic ); mVB.set( GFX, mVertCount, GFXBufferTypeStatic );
ScatterSkyVertex *pVert = mVB.lock(); GFXVertexP *pVert = mVB.lock();
if(!pVert) return; if(!pVert) return;
for ( U32 y = 0; y < vertStride; y++ ) for ( U32 y = 0; y < vertStride; y++ )

View file

@ -57,14 +57,6 @@ class TimeOfDay;
class CubemapData; class CubemapData;
class MatrixSet; class MatrixSet;
GFXDeclareVertexFormat( ScatterSkyVertex )
{
Point3F point;
VectorF normal;
GFXVertexColor color;
};
class ScatterSky : public SceneObject, public ISceneLight class ScatterSky : public SceneObject, public ISceneLight
{ {
typedef SceneObject Parent; typedef SceneObject Parent;
@ -228,7 +220,7 @@ protected:
// Prim buffer, vertex buffer and shader for rendering. // Prim buffer, vertex buffer and shader for rendering.
GFXPrimitiveBufferHandle mPrimBuffer; GFXPrimitiveBufferHandle mPrimBuffer;
GFXVertexBufferHandle<ScatterSkyVertex> mVB; GFXVertexBufferHandle<GFXVertexP> mVB;
GFXShaderRef mShader; GFXShaderRef mShader;
GFXStateBlockRef mStateBlock; GFXStateBlockRef mStateBlock;

View file

@ -36,14 +36,9 @@ float vernierScale(float fCos)
} }
in vec4 vPosition; in vec4 vPosition;
in vec3 vNormal;
in vec4 vColor;
in vec2 vTexCoord0;
// This is the shader input vertex structure. // This is the shader input vertex structure.
#define IN_position vPosition #define IN_position vPosition
#define IN_normal vNormal
#define IN_color vColor
// This is the shader output data. // This is the shader output data.
out vec4 rayleighColor; out vec4 rayleighColor;

View file

@ -39,10 +39,6 @@ struct Vert
{ {
// .xyz = point // .xyz = point
float4 position : POSITION; float4 position : POSITION;
float3 normal : NORMAL;
float4 color : TEXCOORD0;
}; };
// This is the shader output data. // This is the shader output data.

View file

@ -36,14 +36,9 @@ float vernierScale(float fCos)
} }
in vec4 vPosition; in vec4 vPosition;
in vec3 vNormal;
in vec4 vColor;
in vec2 vTexCoord0;
// This is the shader input vertex structure. // This is the shader input vertex structure.
#define IN_position vPosition #define IN_position vPosition
#define IN_normal vNormal
#define IN_color vColor
// This is the shader output data. // This is the shader output data.
out vec4 rayleighColor; out vec4 rayleighColor;

View file

@ -39,10 +39,6 @@ struct Vert
{ {
// .xyz = point // .xyz = point
float4 position : POSITION; float4 position : POSITION;
float3 normal : NORMAL;
float4 color : TEXCOORD0;
}; };
// This is the shader output data. // This is the shader output data.