mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Rendering issues
This commit is contained in:
@@ -14,7 +14,7 @@ asset.require('util/default_dashboard')
|
||||
|
||||
asset.require('util/webgui')
|
||||
|
||||
asset.request('customization/globebrowsing')
|
||||
--asset.request('customization/globebrowsing')
|
||||
|
||||
-- asset.request('scene/solarsystem/planets/earth/satellites/satellites_all')
|
||||
asset.request('scene/solarsystem/planets/earth/satellites/satellites_debris')
|
||||
|
||||
@@ -609,8 +609,8 @@ void RenderableSatellites::initializeGL() {
|
||||
_uniformCache.modelView = _programObject->uniformLocation("modelViewTransform");
|
||||
_uniformCache.projection = _programObject->uniformLocation("projectionTransform");
|
||||
_uniformCache.color = _programObject->uniformLocation("color");
|
||||
_uniformCache.useLineFade = _programObject->uniformLocation("useLineFade");
|
||||
_uniformCache.lineFade = _programObject->uniformLocation("lineFade");
|
||||
//_uniformCache.useLineFade = _programObject->uniformLocation("useLineFade");
|
||||
//_uniformCache.lineFade = _programObject->uniformLocation("lineFade");
|
||||
|
||||
setRenderBin(Renderable::RenderBin::Overlay);
|
||||
|
||||
@@ -654,10 +654,10 @@ void RenderableSatellites::render(const RenderData& data, RendererTasks&) {
|
||||
|
||||
_programObject->setUniform(_uniformCache.projection, data.camera.projectionMatrix());
|
||||
_programObject->setUniform(_uniformCache.color, _appearance.lineColor);
|
||||
_programObject->setUniform(_uniformCache.useLineFade, _appearance.useLineFade);
|
||||
if (_appearance.useLineFade) {
|
||||
_programObject->setUniform(_uniformCache.lineFade, _appearance.lineFade);
|
||||
}
|
||||
//_programObject->setUniform(_uniformCache.useLineFade, _appearance.useLineFade);
|
||||
//if (_appearance.useLineFade) {
|
||||
// _programObject->setUniform(_uniformCache.lineFade, _appearance.lineFade);
|
||||
//}
|
||||
|
||||
|
||||
glDepthMask(false);
|
||||
@@ -665,13 +665,22 @@ void RenderableSatellites::render(const RenderData& data, RendererTasks&) {
|
||||
|
||||
// Crashes in here
|
||||
glBindVertexArray(_vertexArray);
|
||||
//glDrawElements(GL_LINES,
|
||||
//static_cast<unsigned int>(_indexBufferData.size()),
|
||||
//GL_UNSIGNED_INT,
|
||||
//0);
|
||||
glDrawArrays(GL_LINES,
|
||||
0,
|
||||
20); //static_cast<unsigned int>(_indexBufferData.size()));
|
||||
glDrawElements(GL_LINES,
|
||||
//static_cast<unsigned int>(_indexBufferData.size()),
|
||||
20,
|
||||
GL_UNSIGNED_INT,
|
||||
&_indexBufferData.front());
|
||||
//glDrawArrays(GL_LINES,
|
||||
// 0,
|
||||
// 20); //static_cast<unsigned int>(_indexBufferData.size()));
|
||||
/*
|
||||
glBegin (GL_LINES);
|
||||
glVertex3f (_vertexBufferData[0].x, _vertexBufferData[0].y, _vertexBufferData[0].z);
|
||||
glVertex3f (_vertexBufferData[1].x, _vertexBufferData[1].y, _vertexBufferData[1].z);
|
||||
glVertex3f (_vertexBufferData[2].x, _vertexBufferData[2].y, _vertexBufferData[2].z);
|
||||
glVertex3f (_vertexBufferData[3].x, _vertexBufferData[3].y, _vertexBufferData[3].z);
|
||||
glEnd ();
|
||||
*/
|
||||
glBindVertexArray(0);
|
||||
|
||||
_programObject->deactivate();
|
||||
@@ -725,7 +734,6 @@ void RenderableSatellites::updateBuffers() {
|
||||
_vertexBufferData.data(),
|
||||
GL_STATIC_DRAW
|
||||
);
|
||||
|
||||
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer);
|
||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER,
|
||||
@@ -733,9 +741,10 @@ void RenderableSatellites::updateBuffers() {
|
||||
_indexBufferData.data(),
|
||||
GL_STATIC_DRAW
|
||||
);
|
||||
|
||||
glBindVertexArray(0);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,14 +27,15 @@
|
||||
|
||||
uniform vec3 color;
|
||||
uniform float opacity = 1.0;
|
||||
uniform bool useLineFade;
|
||||
uniform float lineFade;
|
||||
//uniform bool useLineFade;
|
||||
//uniform float lineFade;
|
||||
|
||||
in vec4 viewSpacePosition;
|
||||
|
||||
Fragment getFragment() {
|
||||
Fragment frag;
|
||||
frag.color = vec4(0.0, 0.0, 0.5, opacity);
|
||||
frag.color = vec4(color, opacity);
|
||||
// frag.color = vec4(0.0, 0.0, 1.0, 1.0);
|
||||
frag.depth = safeLength(viewSpacePosition);
|
||||
frag.blend = BLEND_MODE_ADDITIVE;
|
||||
frag.gPosition = viewSpacePosition;
|
||||
|
||||
@@ -28,10 +28,10 @@ layout(location = 0) in vec4 vertexData;
|
||||
|
||||
uniform dmat4 modelViewTransform;
|
||||
uniform mat4 projectionTransform;
|
||||
uniform bool useLineFade;
|
||||
uniform float lineFade;
|
||||
uniform int vertexSortingMethod;
|
||||
uniform int pointSize;
|
||||
//uniform bool useLineFade;
|
||||
//uniform float lineFade;
|
||||
//uniform int vertexSortingMethod;
|
||||
//uniform int pointSize;
|
||||
|
||||
out vec4 viewSpacePosition;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user