c42f / Displaz.jl

Julia bindings for the displaz lidar viewer
Other
16 stars 16 forks source link

clearplot() before plot3d() "breaks" default shader #16

Open cbecker opened 7 years ago

cbecker commented 7 years ago

I am not sure why this is happening, but I get no colors shown if I do:

using Displaz

fig = Displaz.newfigure()
clearplot(fig)
plot3d!(fig, rand(3,10), color=[Colors.RGB(1.0,1.0,0.0) for i=1:10])

In contrast to it working if I do

using Displaz

fig = Displaz.newfigure()
plot3d!(fig, rand(3,10), color=[Colors.RGB(1.0,1.0,0.0) for i=1:10])

This may have to do with the shader set by plot3d!, but from what I see it is hardcoded to generic_points.glsl, could it be that it's being overriden by Displaz itself (the binary)?

cbecker commented 7 years ago

From what I see it has to be with the displaz backend. A workaround is to pass the shader to -clear:

using Displaz

fig = Displaz.newfigure()
clearplot(fig, "-shader generic_points.glsl")
plot3d!(fig, rand(3,10), color=[Colors.RGB(1.0,1.0,0.0) for i=1:10])

I am not sure whether this is an intended behavior, nor where to go to fix it.

c42f commented 7 years ago

Yes, I'm afraid this is an inconsistency in the C++ code, which leads a weird double life as a GUI lidar viewer and scriptable 3D window... See

https://github.com/c42f/displaz/issues/131

cbecker commented 7 years ago

Thanks, I see it's a know issue. At least so far we have that workaround, it's been useful to me.