More fixes on RenderableStars

This commit is contained in:
Alexander Bock
2015-02-09 18:06:01 +01:00
parent 7d6792eba0
commit a8a688398c
4 changed files with 13 additions and 16 deletions

View File

@@ -73,8 +73,7 @@ void main() {
break;
}
framebuffer_output_color = texture(psfTexture, texCoord) * color;
vec4 fullColor = texture(psfTexture, texCoord) * color;
// framebuffer_output_color = vec4(vs_position.rgb, 1.0);
@@ -83,12 +82,14 @@ void main() {
// framebuffer_output_color = vec4(vec3(abs(ge_brightness.z)), 1.0);
vec4 position = vs_position;
float depth = pscDepth(position);
gl_FragDepth = depth;
// This has to be fixed when the scale graph is in place ---abock
// float depth = pscDepth(position);
float depth = 10000.0;
// gl_FragDepth = depth;
//ABufferStruct_t frag = createGeometryFragment(vec4(1,0,0,1), position, depth);
//ABufferStruct_t frag = createGeometryFragment(diffuse, position, depth);
//addToBuffer(frag);
ABufferStruct_t frag = createGeometryFragment(fullColor, position, depth);
addToBuffer(frag);
// framebuffer_output_color = fullColor;
//discard;

View File

@@ -80,10 +80,8 @@ void main() {
// p = vec4(vec3(apparent), 1.0);
vec4 P = gl_in[0].gl_Position;
// check everything below this ---abock
float weight = 0.00001f; // otherwise this takes over.
float weight = 0.000005f; // otherwise this takes over.
double depth = pc[0] * pow(10, pc[1]);
depth *= pow(apparent,3);
@@ -92,10 +90,10 @@ void main() {
// EMIT QUAD
for(int i = 0; i < 4; i++){
vec4 p1 = P;
vec4 p1 = gl_in[0].gl_Position;
p1.xy += vec2(modifiedSpriteSize * (corners[i] - vec2(0.5)));
vs_position = p1;
gl_Position = projection * p1;
gl_Position = projection * p1;
// gl_Position = z_normalization(projection * p1);
texCoord = corners[i];
// p = psc_position[0];

View File

@@ -199,9 +199,7 @@ void RenderableStars::render(const RenderData& data) {
glBindVertexArray(_vao);
const GLsizei nStars = static_cast<GLsizei>(_fullData.size() / _nValuesPerStar);
//glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
glDrawArrays(GL_POINTS, 0, nStars);
//glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
glDrawArrays(GL_POINTS, 0, nStars);
glBindVertexArray(0);
_program->setIgnoreUniformLocationError(false);