Comments (3)
Great suggestion. From what it looks like, it should be faster (since it uses no trigonometric functions). If you would like to work on it, then I will gladly help. What you would need to implement is mainly 3 functions: one to encode, another to decode, and one which will convert an angle(in radians or degrees) which would return a minimal number of bits required to save the normal with a given precision. Their signature could look something like that:
fn encode(normal:Vec3,prec_bits:u8)->(f64,f64)
fn decode(a:f64,b:f64)->Vector3
fn bits_from_angle(angle:f64)->u8
I can then take those functions and add tmf
-specific stuff around them.
However, this may take me some time(I am going on a short vacation soon and the project has some work that is has more impact). This is the ranking of size of different segments in the example mesh:
- NormalSegment: 16.92 kb
- UvSegment: 28.559 kb,
- VertexSegment: 41.839 kb,
- NormalTriangleSegment: 74.119 kb,
- VertexTriangleSegment: 76.101 kb,
- UvTriangleSegment: 76.593 kb,
Total size: 314.131kb
As you can see, normals themselves already do not take all that much space, so the size reduction would be small, but the improvement in speed could be a nice bonus.
from tmf.
The hemioct
method on page 27 of https://jcgt.org/published/0003/02/01/paper.pdf is also worth looking into. Greater accuracy than oct32p
.
from tmf.
The
hemioct
method on page 27 of https://jcgt.org/published/0003/02/01/paper.pdf is also worth looking into. Greater accuracy thanoct32p
.
This seems like a good idea for normal maps, but I'm not sure about arbitrary vectors since you have to worry about the other hemisphere as well (adding a z sign bit, and at that point the accuracy/size improvement is lost). It could be faster, though.
from tmf.
Related Issues (12)
- [FEATURE] Tangent vertex attribute HOT 8
- [BUG] Triangle segment spilling has some weird issues. HOT 2
- Delta encoding [FEATURE] HOT 1
- Shared Index Segment Type[FEATURE] HOT 4
- [META] Preparations for 0.2: What is missing.
- How does this compare to draco? HOT 6
- [FEATURE] Support for quads HOT 1
- Add size comparisons with GLTF HOT 2
- [FEATURE] Support arbitrary vertex attributes HOT 6
- Question: Why have distinct index buffers per attribute? HOT 2
- [BUG] tmf Doesn't compile with the `fast_trig` feature enabled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmf.