https://github.com/talon1024/rustmd3view
https://github.com/talon1024/rustmd3view
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/talon1024/rustmd3view
- Owner: Talon1024
- Created: 2022-10-26T01:46:47.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-10-31T21:44:45.000Z (9 months ago)
- Last Synced: 2025-11-03T23:12:48.721Z (9 months ago)
- Language: Rust
- Size: 912 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
OpenGL Hack: Vertex animation as a texture
==========================================
This is a demo of an "OpenGL hack" I thought up.
The hack
--------
After uploading a texture to the GPU, you reference it in the shader as a [sampler](https://www.khronos.org/opengl/wiki/Sampler_%28GLSL%29) uniform, and use the texture by calling the `texture` function with the sampler and a texture coordinate.
The `texture` function returns a `vec4`, which doesn't necessarily have to be a pixel colour. So what if I used it as a vertex position?!
What are the benefits and drawbacks?
----------------------
- ✔ Less CPU usage
- ✔ Fewer uploads
- ❌ More GPU usage... But GPUs have plenty of power to spare.
Did you say "hack"?!
--------------------
By "hack", I mean a clever trick.