Hello!
I am in the process of updating https://FreecivX.net from WebGL to WebGPU.
I am reaching out to the Three.js devs here for help to port the shader from GLSL3 to TSL.
This is the shader code:
I would like to use this transpiler:
https://threejs.org/examples/webgpu_tsl_transpiler
So I would appreciate some help porting this shader to TSL. Some questions:
- What is the best source for documentation for learning TSL? ( Three.js Shading Language · mrdoob/three.js Wiki · GitHub )
- The transpiler isn’t able to define the ‘in’ and ‘out’ parameters. The ‘out’ parameter should be the result colour. How can I port the in and out parameters to TSL?
- How can I initialize this shader in Javascript?
- How to I specify the shader data, such as textures, in JavaScript?
- How to I apply this shader as a shader material to the Mesh for the terrain?
- Are there any examples using WebGPU Shading Language (WGSL) directly on a Mesh in Three.js? three.js/examples/webgpu_compute_texture_pingpong.html at dev · mrdoob/three.js · GitHub
This is for the open source FreecivX 3D project. Thank you!
Andreas