Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/typegpu-docs/src/examples/rendering/smoky-triangle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ function frame(timestamp: number) {
}
frameId = requestAnimationFrame(frame);

const initialToColorBufferValue = d.vec3f(1.538, 0.784, 2);
const initialToColorPickerValue = d.vec3f(0.965, 0.784, 0.98);
Comment thread
cieplypolar marked this conversation as resolved.
export const controls = {
Distortion: {
initial: 0.05,
Expand All @@ -119,8 +121,12 @@ export const controls = {
},
},
'To Color': {
initial: [1.538, 0.784, 2],
initial: initialToColorPickerValue,
onColorChange(value: readonly [number, number, number]) {
if (value === initialToColorPickerValue) {
Comment thread
cieplypolar marked this conversation as resolved.
paramsUniform.writePartial({ toColor: initialToColorBufferValue });
return;
}
paramsUniform.writePartial({ toColor: d.vec3f(...value) });
},
},
Expand All @@ -142,7 +148,7 @@ export const controls = {
distortion: 0.05,
sharpness: 4.5 ** 2,
fromColor: d.vec3f(0.057, 0.2235, 0.4705),
toColor: d.vec3f(1.538, 0.784, 2),
toColor: initialToColorBufferValue,
polarCoords: 0,
squashed: 1,
});
Expand Down
Loading