Files

2.1 KiB

title, type, source, source_url, author, handle, post_id, date, archived, draft, tags, description, in_reply_to
title type source source_url author handle post_id date archived draft tags description in_reply_to
It sure would be nice if we had a 100% common language syntax and function library instead of a bunch of random differences among GLSL, HLSL, and PSSL. archive twitter https://x.com/EricLengyel/status/1475217195193942018 Eric Lengyel EricLengyel 1475217195193942018 2021-12-26 2026-08-27 false
archive
twitter
EricLengyel
It sure would be nice if we had a 100% common language syntax and function library instead of a bunch of random differences among GLSL, HLSL, and PSSL.

Source

Thread

1/ @EricLengyel ^1475217195193942018

It sure would be nice if we had a 100% common language syntax and function library instead of a bunch of random differences among GLSL, HLSL, and PSSL. Anybody know why Cg didn't work out? I remember it being very well done.

2/ @EricLengyel ^1475217797504327683

HLSL and PSSL have float, float2, float3, and float4. GLSL has float, vec2, vec3, and vec4.

HLSL and PSSL have lerp(). GLSL has mix().

HLSL and PSSL have frac(). GLSL has fract().

HLSL and PSSL have ddx() and ddy(). GLSL has dFdx() and dFdy().

3/ @EricLengyel ^1475218316696252418

HLSL has Texture2DArray. PSSL has Texture2D_Array. GLSL has sampler2DArray.

4/ @EricLengyel ^1475244563203719169

HLSL has bool frontFacing : SV_IsFrontFace. PSSL has float frontFacing : S_FRONT_FACE. GLSL has bool gl_FrontFacing.

Branches: archive/threads/EricLengyel/2021-12-26-it-sure-would-be-nice-if-we-had-a-100-common/2021-12-26-hakimshafaei-wgsl-webgpu-has-its-own-story-as-well, archive/threads/EricLengyel/2021-12-26-it-sure-would-be-nice-if-we-had-a-100-common/2021-12-27-Dennis_A_Landi-it-looks-like-a-wrapper-interface-needs-to-be, archive/threads/EricLengyel/2021-12-26-it-sure-would-be-nice-if-we-had-a-100-common/2021-12-27-KeelanStuart-iirc-there-is-also-a-difference-with-saturate-and