Skip to content

Latest commit

 

History

History
45 lines (37 loc) · 58.1 KB

File metadata and controls

45 lines (37 loc) · 58.1 KB

WebGPU Shader Editor (WGSL)

<script src="shader_editor.js" defer></script>

<textarea class="highlight" id="webgpuFragmentShader" spellcheck="false" style="width: 95%; height: 275px; min-height: 100px; max-height: 750px; overflow-y: scroll; white-space: break-spaces; padding: 10px; border-style: solid; border-width: 1px; margin-bottom: 0px; resize: vertical;"></textarea> Run

Reset camera

Click on the canvas to control the camera.

Use WASD to move the camera.

Use arrow keys to rotate the camera.

Use space to go up and left shift to go down.

Pre-defined variables:

time: f32 - Current timestamp in seconds, starting from 0.0 at application launch.
cameraPosition: vec3f - Current position of the camera, starting at vec3f(0.0, 0.0, 0.0).
cameraDirection: vec3f - Current direction of the camera, starting at vec3f(0.0, 0.0, 1.0).
resolution: vec2u - Resolution, is 980u by 600u pixels.
mouse: vec2i - Mouse position in pixels, top-left corner is (0, 0).

Examples

Bases

Creations