3 ms·
> I wonder why people haven't coalesced around HLSL I mean, people kind of have, because Unity uses it (and Unreal too I think). > I vastly prefer defining ve
by pcwalton 3y ago
> I wonder why people haven't coalesced around HLSL
I mean, people kind of have, because Unity uses it (and Unreal too I think).
> I vastly prefer defining vertices as structs
I agree, and note that WGSL lets you do this.
> It makes much more sense to me to define structs with semantics over saying location(X) for each var or addressing uniforms by name/string.
I feel like semantics are a straitjacket, as though the compiler is forcing me to choose from a predefined list of names instead of letting me choose my own. Having to use TEXCOORDn for things that aren't texture coordinates is weird.
> I often see GLSL to HLSL transpilers, but not vice-versa, which is weird because HLSL is the more ergonomic language to me
Microsoft and Khronos support this now [1]. Microsoft's dxc can compile HLSL to SPIR-V, which can then be decompiled to GLSL with SPIRV-Cross.
In general, I prefer GLSL to HLSL because GLSL doesn't use semantics, and because GLSL has looser implicit conversions between scalars and vectors (this continually bites me when writing HLSL). But I highly suspect people just prefer what they started with and perfectly understand people who have the opposite opinion. In any case, WGSL feels like the best of both worlds and a few newer engines like Bevy are adopting it.
[1]: https://www.khronos.org/blog/hlsl-first-class-vulkan-shading-language https://www.khronos.org/blog/hlsl-first-class-vulkan-shading...