I'm NOT asking how to render voxels. I'm asking how should I put my voxel shader! #24331
Unanswered
CoderJo-Pro
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here I'm making a voxel rendering pipeline, where it runs a voxel fragment shader, which uses DDA or octree, not meshes. So the attempts below might not be the best way to do it, please tell me when it's not.
I'm basically learning from documentation agents like zread.ai and deepwiki.com. The goal is to cast rays to the voxels and output PBR material, and get render result from bevy.
At the beginning, I created a node to compute depth and color before meshes. Hope this was correct:
render_app .add_systems(RenderStartup, init_voxel_pipeline) .add_render_graph_node::<ViewNodeRunner<VoxelNode>>(Core3d, VoxelLabel) .add_render_graph_edges( Core3d, ( Node3d::StartMainPass, VoxelLabel, Node3d::MainOpaquePass, ), );And with some ray casts calculated from
Viewuniform, it worked. I then attempted to integrate the voxels directly to bevy's PBR. Switching to deferred rendering sounds like an obvious choice.According to the doc agent, I should use several WGSL functions from
bevy_pbrto makePbrInputinto a G-Buffer texel. Hope this make sense to you:Actually, none of that matters. Because obviously
wgpuis not happy about this. The uniforms are whether not exited, or conflicting with my own voxel shader'sViewuniform.Of course it would... I imported the functions from
bevy_pbr, and I have to bind their uniforms too. But God they are so many! I have to bind all of them, and I have to do it manually.Hold on, the doc agent tells me there is
MeshViewBindGroup.main_offsetthat I can pass in torender_pass.set_bind_group(). But it turns out that it's a new feature from the main branch (where those doc agents are based on).So, my crate depends on bevy
0.18, there has to be some way to get these uniforms' indices. Ok, I admit that I have to do it manually, but how?Beta Was this translation helpful? Give feedback.
All reactions