mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-27 14:39:20 -06:00
trying to fix orthogonal projection issue.
This commit is contained in:
Submodule openspace-data updated: 14fcea5a8d...820a067f7f
@@ -66,18 +66,17 @@ void main() {
|
||||
|
||||
vec4 raw_pos = psc_to_meter(vertex, _scaling);
|
||||
vec4 projected = ProjectorMatrix * ModelTransform * raw_pos;
|
||||
|
||||
|
||||
projected.x /= projected.w;
|
||||
projected.y /= projected.w;
|
||||
|
||||
vec4 normal = normalize(ModelTransform * vec4(vertex.xyz,0));
|
||||
|
||||
vec3 normal = normalize(ModelTransform * vec4(vertex.xyz,0)).xyz;
|
||||
|
||||
//"in range"
|
||||
if(inRange(projected.x, 0, 1) &&
|
||||
inRange(projected.y, 0, 1) &&
|
||||
dot(normal.xyz,vs_boresight) < -0.09 ){
|
||||
color = texture(texture1, projected.xy);
|
||||
// color.a = 1.0f;
|
||||
if((inRange(projected.x, 0, 1) &&
|
||||
inRange(projected.y, 0, 1)) &&
|
||||
dot(normal, vs_boresight) < 0){
|
||||
color = texture(texture1, projected.xy);
|
||||
}else{
|
||||
color = vec4(1,0,0,0);
|
||||
}
|
||||
|
||||
@@ -177,9 +177,9 @@ bool RenderablePlanetProjection::auxiliaryRendertarget(){
|
||||
size, size, 0.0f, w, 1, 0,
|
||||
};
|
||||
|
||||
glGenVertexArrays(1, &_quad); // generate array
|
||||
glBindVertexArray(_quad); // bind array
|
||||
glGenBuffers(1, &_vertexPositionBuffer); // generate buffer
|
||||
glGenVertexArrays(1, &_quad); // generate array
|
||||
glBindVertexArray(_quad); // bind array
|
||||
glGenBuffers(1, &_vertexPositionBuffer); // generate buffer
|
||||
glBindBuffer(GL_ARRAY_BUFFER, _vertexPositionBuffer); // bind buffer
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
|
||||
glEnableVertexAttribArray(0);
|
||||
@@ -213,7 +213,7 @@ void RenderablePlanetProjection::imageProjectGPU(){
|
||||
glGetIntegerv(GL_VIEWPORT, m_viewport);
|
||||
|
||||
static int counter = 0;
|
||||
if (counter > 1){ // every something frame for now..
|
||||
if (counter > 50){ // every something frame for now..
|
||||
counter = 0;
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, _fboID);
|
||||
// set blend eq
|
||||
|
||||
Reference in New Issue
Block a user