Open code, practice, and notes →
Download source with English comments · for reading
GLSL · 28 Interaction and Cost
Series contents · Technology map
Stage: Interaction, Postprocessing, and Cost Evaluation · Editable example · Storage ID: glsl-03
Goals and learning outcomes
- Integrate an interactive shader.
- Choose settings based on quality and cost.
Prerequisites
Continue using the output and records from Unit 27. Before experimenting with Interaction and Cost, preserve the previous inputs and reference outputs.
Key concepts and explanations
Integrating Effects
Pointers, waves, noise, and texture samples have different inputs and costs. Separating effects so they can be disabled makes results and costs easier to track.
Evidence for Results
Choosing a faster setting must account for quality loss and support requirements. Do not present estimates for untested environments as measured performance.
Practice setup
The existing glsl-03 preview is a starting point. It does not replace implementation or verification of the full subsequent assignment. This document-guided exercise requires your own implementation using WebGL2 and GLSL ES 3.00 in a separate localhost project. First check the GLSL version of existing examples and avoid mixing in 1.00 syntax.
The linked example is a starting point. It does not implement every task below. Complete work beyond its supported scope in a separate project.
Practice tasks
- Connect pointer waves and per-effect toggles to the final shader, and replay three presets.
- Change resolution, iteration count, and sample count one at a time, recording images and frame-interval distributions.
- Check compilation errors and recovery, then record the selected settings and remaining limitations in report.md.
Variables to observe
| Variable | Baseline | Change | Expected change / hypothesis |
|---|---|---|---|
| Iteration count | 4 | 2 | Expect possible reductions in both computation and fine detail, and check with the same inputs. |
Predictions in this table are not measured results. Change one condition at a time and record why the actual result differs.
Completion criteria
- Keep a separate controlled comparison for each of the three cost variables.
- Provide compilation-failure and recovery evidence and two quality-loss items.
Self-check
- How do you choose between disabling a feature and reducing resolution?
- Which costs have you not yet isolated in this measurement?
Official references
Linked example and execution scope
Example source · Runtime environments and limits
Source code and records are not overwritten automatically. Resetting an existing example also preserves your notes.