You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TSL Transpiler seems to lack a few elements such as mat3, mat4, texelFetch, texture2D and so on. I created a sample to quickly check what's missing.
Reproduction steps
Add a mat3, mat4 ect and the code will not transpile properly.
Code
Sample generated with AI:
float a =1.0;
vec2 b;
vec3 c;
vec4 d;
mat3 e;
mat4 f;
vec4 g =texture2D();
vec4 h = texture2DArray();
// Basic arithmetic testsfloat i = a +0.5;
vec2 j = b +vec2(1.0, 2.0);
vec3 k = c -vec3(0.5, 0.5, 0.5);
vec4 l = d *vec4(2.0, 2.0, 2.0, 2.0);
mat3 m = e *mat3(1.0);
mat4 n = f +mat4(1.0);
// Vector and matrix multiplication testsvec3 o =vec3(1.0, 0.0, 0.0) * e;
vec4 p =vec4(1.0, 0.0, 0.0, 1.0) * f;
// Function call testsvec4 q =texture2D(g, vec2(0.5, 0.5));
vec4 r = texture2DArray(h, vec3(0.5, 0.5, 1.0));
// Conditional testsif (a >0.5) {
a =2.0;
}
// Loop testsfor (int s =0; s <5; s++) {
a +=1.0;
}
// Texture access testsvec4 t =texture2D(g, vec2(a, i));
vec4 u = texture2DArray(h, vec3(j.x, j.y, 0.0));
// Complex expression testsvec4 v =mix(q, r, 0.5);
vec3 w =normalize(vec3(p.x, p.y, p.z));
// Uniform variable testsuniformmat4 uMatrix;
vec4 x = uMatrix *vec4(1.0, 1.0, 1.0, 1.0);
// Sampler testsuniformsampler2D uSampler;
vec4 y =texture2D(uSampler, vec2(0.5, 0.5));
// texelFetch testsivec2 texelCoord2D =ivec2(10, 20);
vec4 z = texelFetch(uSampler, texelCoord2D, 0);
// texture2DArray testsuniformsampler2DArray uSampler2DArray;
vec4 aa = texture2DArray(uSampler2DArray, vec3(0.5, 0.5, 1.0));
// textureCube testsuniformsamplerCube uSamplerCube;
vec4 ab =textureCube(uSamplerCube, vec3(1.0, 0.0, 0.0));
// texture3D testsuniformsampler3D uSampler3D;
vec4 ac =texture3D(uSampler3D, vec3(0.5, 0.5, 0.5));
// Shadow texture testsuniformsampler2DShadow uSamplerShadow;
float shadowCoord =0.5;
vec4 ad =shadow2D(uSamplerShadow, vec3(0.5, 0.5, shadowCoord));
// More complex texelFetch testivec3 texelCoord3D =ivec3(5, 5, 1);
vec4 ae = texelFetch(uSampler2DArray, texelCoord3D, 0);
// Texture sampling with varying coordinatesvec4 af =textureCube(uSamplerCube, normalize(c));
// Testing texture3D with non-uniform coordinatesvec3 nonUniformCoord =vec3(a, k.x, o.y);
vec4 ag =texture3D(uSampler3D, nonUniformCoord);
vec3 arr[2] =vec3[2](
vec3(0.,0.,0.),
vec3(0.,0.,0.),
);
#ifdef USE_UV
#endif
Most of the missing elements presented in this issue should be fixed by the latest PRs. If certain GLSL statements do not work yet, it's best to create separate issues.
Description
The TSL Transpiler seems to lack a few elements such as mat3, mat4, texelFetch, texture2D and so on. I created a sample to quickly check what's missing.

Reproduction steps
Add a
mat3
,mat4
ect and the code will not transpile properly.Code
Sample generated with AI:
Live example
Version
r160
The text was updated successfully, but these errors were encountered: