Closed bvssvni closed 8 years ago
@kvark I am trying to get the line renderer working by changing create_pipeline_simple
into this:
let set = factory.create_shader_set(&VERTEX_SRC[1], &FRAGMENT_SRC[1]).unwrap();
let mut rasterizer = gfx::state::Rasterizer {
front_face: gfx::state::FrontFace::CounterClockwise,
cull_face: gfx::state::CullFace::Nothing,
method: gfx::state::RasterMethod::Line(1),
offset: None,
samples: None,
};
let pso = try!(factory.create_pipeline_state(
&set, gfx::Primitive::LineList, rasterizer, pipe::new()
));
Still not working. Any ideas?
This code looks good to me. Could you provide an apitrace dump?
I'm looking through the traces, trying to make sense of it.
This looks suspicious:
280 glViewport(x = 0, y = 0, width = 0, height = 0)
Thanks @bvssvni ! I can see 2 draw calls a frame. One is GL_LINES, another is GL_TRIANGLES. I assume we are investigating the first one. There are at least 2 differences being apparent:
glDrawArrays(mode = GL_LINES, first = 0, count = 20)
, while Upd uses glDrawArrays(mode = GL_LINES, first = 0, count = 64)
glPolygonMode(face = GL_FRONT_AND_BACK, mode = GL_FILL)
, while Upd uses glPolygonMode(face = GL_FRONT_AND_BACK, mode = GL_LINE)
For an experiment, perhaps you could try using state::Rasterizer::new_fill()
for the rasterizer parameter?
It works! I changed to Rasterizer::new_fill
and saw a glimpse of some lines. It was the z-buffer not being cleared to 1.0 before rendering.
Perhaps the z buffer should be disabled?
@bvssvni Good! I believe this library draws both on-screen and in the world space. So Z is needed.
Added support for flexible target. The only thing left is shader picking, but this requires gfx_app or a way to map version for the shader_version library.
Merging.
\o/
On Jul 17, 2016, at 12:20, Sven Nilsen notifications@github.com wrote:
Merged #63.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.