Wgpu Users

974 Members
wgpu users discussion52 Servers

Load older messages

4 Mar 2024
@banbee:matrix.orgkaphulaAlthough wgpu does not seem to support DXT formats or am I wrong?03:17:16
@banbee:matrix.orgkaphulanvm, there is mention of DXT in the formats, maybe I confused them together03:18:35
@cwfitzgerald:matrix.orgcwfitzgerald (wgpu, rend3)
In reply to @banbee:matrix.org
Okay, I think I can live with this and without cube maps. Although it would be cool if there would be a crate that would allow me to compress to BC formats and output ktx2 files within the Rust code as I have external asset library that does all the asset processing for my project.
You can do cubemaps with the script I showed (that's what it's generating), you just need the mogrify step
@cwfitzgerald:matrix.orgcwfitzgerald (wgpu, rend3)
In reply to @banbee:matrix.org
chatgpt told me that BC7 (and DXT as fallback) are the best compression formats when targeting desktop only with maximal hardware compatibility. Is it true?
Yes no kinda?
@cwfitzgerald:matrix.orgcwfitzgerald (wgpu, rend3)
In reply to @banbee:matrix.org
Although wgpu does not seem to support DXT formats or am I wrong?
Dxt1 = BC1, DXT3 = BC2, DXT5 = BC3
@banbee:matrix.orgkaphulaoh I see03:20:43
@cwfitzgerald:matrix.orgcwfitzgerald (wgpu, rend3)BCn is the only thing supported on desktop03:21:53
@banbee:matrix.orgkaphulaany reason why you chose compressonator over the khronos ktx tools?03:22:05
@cwfitzgerald:matrix.orgcwfitzgerald (wgpu, rend3)BC7 is the highest quality RGBA, but is 8bpp, BC1 only has a single bit of alpha bit is 4bpp03:24:19
@cwfitzgerald:matrix.orgcwfitzgerald (wgpu, rend3)BC6 is HDR @ 8bpp03:24:43
@cwfitzgerald:matrix.orgcwfitzgerald (wgpu, rend3)BC4 is single channel @ 4bpp03:24:58
@cwfitzgerald:matrix.orgcwfitzgerald (wgpu, rend3)BC5 is two independent channels @ 8bpp total03:25:12
@cwfitzgerald:matrix.orgcwfitzgerald (wgpu, rend3)
In reply to @banbee:matrix.org
any reason why you chose compressonator over the khronos ktx tools?
It doesn't support bcn
@banbee:matrix.orgkaphula yeah I was wondering about that while reading the ./toktx --help. There's --bcmp which is deprecated and it links to --encode etc1s but no mentions about BC or DXT. 03:28:10
@cwfitzgerald:matrix.orgcwfitzgerald (wgpu, rend3)Also encoder quality matters a ton03:28:39
@cwfitzgerald:matrix.orgcwfitzgerald (wgpu, rend3)Encoding basically brute force, so encoders need to use heuristics to get closer faster03:29:06
@banbee:matrix.orgkaphulaCool, thanks!03:41:27
@untech:matrix.orgNikolai Kruglikov joined the room.08:44:44
@untech:matrix.orgNikolai KruglikovHi, I'm a graphics and wgpu newbie, sorry for stupid questions. I can't figure out some things through docs and the spec, want to try to lean on the community :) Here's what I currently don't understand. I want to render to a winit-created window. Adapter creates surface from window, then I can get a texture via get_current_texture, then I can get a texture view via create_view, then I can use this view for rendering. Questions: where does surface.configure fits into this picture? Is the configuration step necessary? Why can't the configuration be a part of the surface creation? What would happen if I skip configuration?08:56:14
@wumpf:matrix.orgwumpfwindow surfaces are quite special compared to regular textures. The configure is a necessary step and is sort of what sets up the "glue" between the OS provided surface and wgpu (and the underlying graphics api).08:58:32
@wumpf:matrix.orgwumpf you typically need to configure again whenever get_current_texture fails which may happen e.g. when resizing 09:01:10
@untech:matrix.orgNikolai KruglikovOk, thanks! Should I always set width and height to current window size? What would happen if I set them to something smaller or larger?09:07:25
@untech:matrix.orgNikolai KruglikovAlso, I don't really understand the difference between Bgra8Unorm and Bgra8UnormSrgb. What should I use?09:09:36
@wumpf:matrix.orgwumpf yeah you should always set it to the expected surface size which is usually the window's inner-size. I believe it's platform dependent what happens if you get it wrong, might be stretched or render black; but we recently fixed any ensuing log-spam from that, so the only thing happening at most should be get_current_texture failing
for all other options the safe bet is to use
@wumpf:matrix.orgwumpf Bgra8UnormSrgb applies the srgb gamma curve upon write. I.e. it assumes that the value you're writing is "linear srgb" and then will encode it with the gamma curve when writing.
when you look at the bits of a random bmp on your machine those are usually expected encoded with the srgb gamma curve. Check the transfer function part here https://en.wikipedia.org/wiki/SRGB
@wumpf:matrix.orgwumpf so the decision whether to use Bgra8UnormSrgb or Bgra8Unorm depends upon what kind of color encoding you expect your shaders to produce 09:12:42
@untech:matrix.orgNikolai KruglikovThanks a lot!09:13:04
@wumpf:matrix.orgwumpfthat part comes up every couple of weeks here and is the source of great confusion 😄09:13:20
@wumpf:matrix.orgwumpf * that part comes up every couple of weeks here and is a source of great confusion 😄09:13:30
@banbee:matrix.orgkaphulahttps://learnopengl.com/Advanced-Lighting/Gamma-Correction This is usually a good reminder when you forget what sRGB is. 16:06:11

There are no newer messages yet.

Back to Room ListRoom Version: 5