mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-07 02:21:23 +00:00
this works!
This commit is contained in:
1 parent
fcdee8628e
commit
4868d206af
4 files changed
+26
-18
No files matched your search
+17
-15
@@ -149,9 +149,10 @@ pub fn run(capture_provider: Arc<CaptureProvider>, program_args: ProgramArgs) ->
|
||||
|
||||
if imgui_visualizer_xyz_texture_1.is_none() {
|
||||
// TODO: TEMPORARY MESS TO SUPPORT MULTI-CAMERA
|
||||
if visualizer.xyz_textures.get(1).unwrap().id() != 0 {
|
||||
imgui_visualizer_xyz_texture_1 = Some(TextureId::from(visualizer.xyz_textures.get(1).unwrap().id() as usize));
|
||||
}
|
||||
// TODO/NB(2022-03-20): No multi camera
|
||||
//if visualizer.xyz_textures.get(1).unwrap().id() != 0 {
|
||||
// imgui_visualizer_xyz_texture_1 = Some(TextureId::from(visualizer.xyz_textures.get(1).unwrap().id() as usize));
|
||||
//}
|
||||
}
|
||||
|
||||
Window::new(im_str!("Visualizer XYZ Texture (0)"))
|
||||
@@ -167,18 +168,19 @@ pub fn run(capture_provider: Arc<CaptureProvider>, program_args: ProgramArgs) ->
|
||||
}
|
||||
});
|
||||
|
||||
Window::new(im_str!("Visualizer XYZ Texture (1)"))
|
||||
.size([window_width, window_height], Condition::FirstUseEver)
|
||||
.position([window_width + 50.0, 0.0], Condition::FirstUseEver)
|
||||
.movable(false)
|
||||
.build(&ui, || {
|
||||
match imgui_visualizer_xyz_texture_1.as_ref() {
|
||||
None => {},
|
||||
Some(xyz_texture) => {
|
||||
Image::new(xyz_texture.clone(), [1280.0, 720.0]).build(&ui);
|
||||
},
|
||||
}
|
||||
});
|
||||
// TODO/NB(2022-03-20): No multi camera
|
||||
//Window::new(im_str!("Visualizer XYZ Texture (1)"))
|
||||
// .size([window_width, window_height], Condition::FirstUseEver)
|
||||
// .position([window_width + 50.0, 0.0], Condition::FirstUseEver)
|
||||
// .movable(false)
|
||||
// .build(&ui, || {
|
||||
// match imgui_visualizer_xyz_texture_1.as_ref() {
|
||||
// None => {},
|
||||
// Some(xyz_texture) => {
|
||||
// Image::new(xyz_texture.clone(), [1280.0, 720.0]).build(&ui);
|
||||
// },
|
||||
// }
|
||||
// });
|
||||
|
||||
Window::new(im_str!("Point Cloud Converter XY Table"))
|
||||
.size([window_width, window_height], Condition::FirstUseEver)
|
||||
|
||||
@@ -3,6 +3,7 @@ use anyhow::bail;
|
||||
use gl::types::*;
|
||||
use std::os::raw::c_char;
|
||||
use std::ffi::CString;
|
||||
use crate::opengl::wrapper::other_misc_wrapper::gl_get_error;
|
||||
|
||||
/// A typesafe handle on uniform IDs with convenience methods.
|
||||
#[derive(Clone, Debug, Copy)]
|
||||
@@ -21,7 +22,9 @@ impl Uniform {
|
||||
}
|
||||
|
||||
if loc < 0 {
|
||||
bail!("Couldn't find uniform named '{}' in OpenGL program {}.", identifier, opengl_program_id);
|
||||
let error = gl_get_error();
|
||||
println!("GL Error: {:?}", error);
|
||||
bail!("Couldn't find uniform named '{}' in OpenGL program {}. (err = {})", identifier, opengl_program_id, loc);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
|
||||
@@ -151,6 +151,9 @@ impl PointCloudRenderer {
|
||||
let mut point_cloud_vertex_shader = read_file_string_contents("src/point_cloud/shaders/point_cloud_vertex_shader.glsl").unwrap();
|
||||
let mut point_cloud_fragment_shader = read_file_string_contents("src/point_cloud/shaders/point_cloud_fragment_shader.glsl").unwrap();
|
||||
|
||||
println!("{}", point_cloud_vertex_shader);
|
||||
println!("{}", point_cloud_fragment_shader);
|
||||
|
||||
//let mut point_cloud_vertex_shader = read_file_string_contents("src/point_cloud/shaders/simple_vertex_shader.glsl").unwrap();
|
||||
|
||||
let vertex_shader_id = compile_shader(&point_cloud_vertex_shader, gl::VERTEX_SHADER);
|
||||
|
||||
@@ -27,9 +27,9 @@ void main()
|
||||
|
||||
// TODO/NB(2022-03-20): This is broken - why did GLSL break!?
|
||||
//fragmentColor = texture2D(objTexture, coord);
|
||||
//fragmentColor = texture(objTexture, coord);
|
||||
fragmentColor = texture(objTexture, coord);
|
||||
//fragmentColor = vec4(0, 0, 0, 0);
|
||||
fragmentColor = vertexColor;
|
||||
//fragmentColor = vertexColor;
|
||||
}
|
||||
else if (vertexType == 2)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user