Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about STL Rendering #261

Closed
JohnZhan2023 opened this issue Jan 16, 2025 · 3 comments
Closed

Questions about STL Rendering #261

JohnZhan2023 opened this issue Jan 16, 2025 · 3 comments
Labels
feature request requests for new features

Comments

@JohnZhan2023
Copy link

First of all, I would like to express my gratitude for your outstanding contributions to LBM simulations, which have been of great help to me.

While importing STL files for rendering, I noticed that the detailed shapes of the models appear somewhat blurry, and shadows are not rendered. The specific contours are only relatively clear when displaying the lattice. I would like to confirm whether shadow rendering is currently supported and if there are plans to support it in the future.

Image

Like this one above, we can't ensure its torus shape only according to the one view image.

@ProjectPhysX
Copy link
Owner

Hi @JohnZhan2023,

models might look a bit blurry due to voxelization and marching-cubes surface reconstruction from voxelized geometry. The models are rendered exactly as the physical simulation sees them - discretized on the grid.
The rendering does basic shading (where the light source is set as the camera position), but indeed no shadows are cast. For better front-on shading, you can reduce the gain factor a bit, by changing this line to

return color_mul(c, max(1.0f*fabs(dot(normal, d))*rsqrt(nl2*dl2), 0.3f));

I do not plan to implement shadow casting in the future. I want to keep the renderer as simple as possible without extra clutter.

Kind regards,
Moritz

@JohnZhan2023
Copy link
Author

Thank you for your patient explanation! It does good to me!

@ProjectPhysX ProjectPhysX closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2025
@ProjectPhysX ProjectPhysX added the feature request requests for new features label Jan 19, 2025
@JohnZhan2023
Copy link
Author

If I want to add the shading myself, so how can I revise the code? Can you give me some advice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request requests for new features
Projects
None yet
Development

No branches or pull requests

2 participants