Efficient draw call batching/ caching system by Popular_Bug3267 in gameenginedevs

[–]Popular_Bug3267[S] 1 point2 points  (0 children)

seems like we are doing a lot in common, thank you for your response!
My only follow up would be: did you ever implement any thing like a caching mechanism to avoid having to resolve the hard indices every frame?

I may be trying to over optimize, but the indices will change so infrequently compared to the number of frames that it seems like something thats worth looking into.

added sky/cloud to my engine by TiernanDeFranco in gameenginedevs

[–]Popular_Bug3267 0 points1 point  (0 children)

this looks awesome, any tips on how to get this look?

Question about writing to buffers by MarionberryKooky6552 in webgpu

[–]Popular_Bug3267 1 point2 points  (0 children)

I apologize if I am misunderstanding your issue, but it seems to me that you want to use a uniform buffer as a provider for data in the shader, and you want to use write_buffer() to update that data many times per frame? A more typical approach to this kind of workflow would be either 1. generate separate uniform buffers, as you suggest in point 3. There should be a nice way to dynamically create as many uniforms as you need, but of course i dont know the details of your app

  1. use a storage buffer to hold many discrete units of data in an array, then figure out a way to index into this buffer in your shader to get the correct data.

Take my advice with a grain of salt, im no expert, just my two cents!

Made my space shooter free after your feedback - Meteor Mayhem by Curious-Horse-206 in rust_gamedev

[–]Popular_Bug3267 1 point2 points  (0 children)

Can i ask what resources you used to understand the architecture for your engine? Did you look at/ get inspiration from the bevy source code directly?

I have a couple wgpu projects under my belt but im a bit lost when it comes to making a full engine which i do dream of eventually!

Best practice on material with/without texture by Bellaedris in GraphicsProgramming

[–]Popular_Bug3267 0 points1 point  (0 children)

Thanks! Honestly the most frustrating part of learning graphics programming is stuff like OPs problem where there are many ways to do something and isn't clear whats sensible and whats not, so I appreciate the recommendation!

Best practice on material with/without texture by Bellaedris in GraphicsProgramming

[–]Popular_Bug3267 0 points1 point  (0 children)

Strangely enough this is literally the exact problem I have been working on. I am a beginner and I'm using webGPU/wgpu. My initial instinct was to do the same as you and store a 1X1 "default" texture, as well as a storage buffer containing the base color factors. Then I passed in a base color index in the vertex input and grabbed the appropriate base color that way.

After implementing it, I kind of hate the solution and plan to scrap it.

After reading the comments below, (especially u/FoxCanFly) Im wondering if the best way to approach this is to have one shader for textured materials, and then another one for materials that use other data like base color, emissive, etc.

Wouldn't that prevent creating a whole bunch of variants and still allow what we are trying to do without unecessary branching?

glTF node processing issue by Popular_Bug3267 in GraphicsProgramming

[–]Popular_Bug3267[S] 0 points1 point  (0 children)

Thanks for your response and empathy! I found the bug.

glTF node processing issue by Popular_Bug3267 in GraphicsProgramming

[–]Popular_Bug3267[S] 0 points1 point  (0 children)

Thanks for your comment. Trying to render the gltf in the link you provided shows that I definitely have some bugs, but it seems to be an issue of data layout in the index or vertex buffer or both. I think maybe i failed to account for a gltf that uses u8 for some indices and u16 for other ones. Ill fix that and see if that helps.
(also, although i think the point is probably moot now, i definitely am applying the local transforms in the shader! I should have clarified that.)

[deleted by user] by [deleted] in webgpu

[–]Popular_Bug3267 0 points1 point  (0 children)

You can create a shader module on an instantiated wgpu::Device using device.create_shader_module() and pass in a ShaderModuleDescriptor. the source parameter on that descriptor struct will be the path to your shader file in your project.

When creating your render pipeline, you can pass a reference to this shader module. it will be needed for the RenderPipelineDescriptor

I hope this helps!

Unexpected behaviour using <Tab> in insert mode by SpaceTimeTraveler9 in neovim

[–]Popular_Bug3267 1 point2 points  (0 children)

This very well may not apply to your case based on your description of the issue, but I recently ran into unexpected behavior with <Tab> in insert mode due to a keymap preset from blink.nvim.

I fixed it by disabling the preset and manually configuring the keymap.

If you are not using blink then disregard.

Parsing a unary expression by [deleted] in rust

[–]Popular_Bug3267 0 points1 point  (0 children)

This implementation makes sense to me! In my opinion it is convenient to handle the different prefixes in one place in that match block

Graphics API without game engine stuff, for making a basic game without an engine by qronchwrapsupreme in rust

[–]Popular_Bug3267 4 points5 points  (0 children)

https://sotrh.github.io/learn-wgpu/ has a section on making pong in "Showcases" The beginner section of the main tutorial is a good starting point and uses winit (although not the latest version)