JuliaGL / GLVisualize.jl

Visualization library written in Julia and OpenGL
Other
247 stars 34 forks source link

better iso rendering quality #227

Closed SimonDanisch closed 6 years ago

SimonDanisch commented 6 years ago

improves the rendering from issue: https://github.com/JuliaGL/GLVisualize.jl/issues/190 @louisponet, I hope this gives you a good start, you can also try to play around with the values that I changed! I think to improve the quality further, we'd need better, custom sampling of the texture. With this PR, @louisponet example looks now: image

louisponet commented 6 years ago

Very good, I think i'm starting to understand the algorithm. Increasing max_distace changes the sampling area i.e. makes the sampled surface smoother. Increasing the num_samples increases the total number of points in space so leads to a more dense surface. Not sure what the upper limits to this are with regards to quality vs performance, but I guess that depends on the usecase. Is there any online resource I can consult that fully outlines what the idea behind the algorithm?

With regards to the artifacts on the meshed surfaces (using Meshing.jl or my own implementation), is this related to the same idea?

Also, if I put vol = visualize(points,:iso,isovalue=0.12f0,isorange=0.02f0,model=Mat4f0([cell [0.0,0.0,0.0];[0.0 0.0 0.0 1.0]]),color=RGBA(1.f0,0.f0,0f0,0.8f0)), I get a crash complaining about no color_lookup defined for args(, , , vec4). How did you change the alpha?

In any case this is a very good step forward. Thank you!

SimonDanisch commented 6 years ago

Ah sorry, forgot to add the example code. You need to use: color_map=[RGBA(1.f0,0.f0,0f0,0.1f0), RGBA(1.f0,0.f0,0f0,0.1f0)]... I know this is silly, but I never got around to just implement, that iso takes a single color!

SimonDanisch commented 6 years ago

With regards to the artifacts on the meshed surfaces (using Meshing.jl or my own implementation), is this related to the same idea?

No I don't think so. Didn't we reduce that to faulty transparency rendering?

SimonDanisch commented 6 years ago

Actually, when I look at your example picture, it seems like they cull back faces, which was also a solution to get rid of the mesh artifacts in GLVisualize, even with transparency ;)

louisponet commented 6 years ago

Right, I forgot sorry.