Port starfield to static shaders
parent
9745b125f3
commit
e9ef0f7e57
|
@ -0,0 +1,8 @@
|
|||
#version 120
|
||||
uniform sampler2D starTex;
|
||||
varying vec4 color;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_FragColor = texture2D(starTex, gl_PointCoord) * color;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
#version 120
|
||||
attribute float pointSize;
|
||||
varying vec4 color;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_PointSize = pointSize;
|
||||
color = gl_Color;
|
||||
gl_Position = ftransform();
|
||||
}
|
|
@ -320,16 +320,12 @@ PointStarVertexBuffer::~PointStarVertexBuffer()
|
|||
|
||||
void PointStarVertexBuffer::startSprites()
|
||||
{
|
||||
ShaderProperties shadprop;
|
||||
shadprop.staticShader = true;
|
||||
shadprop.texUsage = ShaderProperties::PointSprite |
|
||||
ShaderProperties::NormalTexture;
|
||||
CelestiaGLProgram* prog = renderer.getShaderManager().getShader(shadprop);
|
||||
CelestiaGLProgram* prog = renderer.getShaderManager().getShader("star");
|
||||
if (prog == nullptr)
|
||||
return;
|
||||
|
||||
prog->use();
|
||||
prog->pointScale = 1.0f;
|
||||
prog->samplerParam("starTex") = 0;
|
||||
|
||||
unsigned int stride = sizeof(StarVertex);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
|
Loading…
Reference in New Issue