getting somewhere, but this is confusing.

Changing textures in the point_cloud_renderer GLSL to be either index 0
or 1 (pointCloudTexture0 or pointCloudTexture1, each corresponding to a
camera) to the opposite of the skip block in the loop on line 611 will
show a perfect shaded image from the non-skipped camera.

This suggests that both cameras are sending texture and color data.
However...

Trying to do a linear combination from non-skipped color data is WEIRD
though, and not as I'd expect.
This commit is contained in:
Brandon Thomas committed 2020-05-18 00:47:55 -04:00
1 parent 56b4271295
commit 983d301554
1 file changed
+12 -10
+12 -10
View File
@@ -60,8 +60,9 @@ impl std::error::Error for PointCloudRendererError {
pub static POINT_CLOUD_VERTEX_SHADER : &'static str = "\
#version 430
// NB: It appears that locations need to be wide enough apart, or the colors bleed across locations.
layout(location = 0) in vec4 inColor0;
layout(location = 1) in vec4 inColor1;
layout(location = 4) in vec4 inColor1;
out vec4 vertexColor;
@@ -109,14 +110,11 @@ void main()
gl_Position = projection * view * vec4(vertexPosition, 1);
vec4 color0 = inColor1;
vec4 color1 = inColor0;
vec4 colorOut = vec4(
color0.r + color1.r,
color0.g + color1.g,
color0.b + color1.b,
color0.a + color1.a
inColor0.r + inColor1.r ,
inColor0.g + inColor1.g ,
inColor0.b + inColor1.b ,
inColor0.a + inColor1.a
);
vertexColor = colorOut;
@@ -530,8 +528,8 @@ impl PointCloudRenderer {
gl::EnableVertexAttribArray(*vertex_attrib_location as u32);
gl::VertexAttribPointer(
//0 as u32,
location as u32, // TODO: Does this matter?
*vertex_attrib_location as u32,
//location as u32, // TODO: Does this matter?
gl::BGRA as i32,
gl::UNSIGNED_BYTE,
gl::TRUE,
@@ -610,6 +608,10 @@ impl PointCloudRenderer {
// Render point cloud
for i in 0 .. self.num_cameras {
if i == 0 {
continue;
}
let vertex_array_object = self.vertex_array_objects.get(i).unwrap(); // TODO: TEMP MULTI-CAMERA SUPPORT
let vertex_array_size_bytes = self.vertex_arrays_size_bytes.get(i).unwrap(); // TODO: TEMP MULTI-CAMERA SUPPORT