Fast light processing
1 post • Page 1 of 1
Fast light processing
Since algodoo 1.8.0 became more than twice slower thyme than 1.6.0 I've try to optimize some of my functions.
Here it is simple brightness calculation:
n - normal vector to geom surface
r - vector to light source
In that example I've store normal in [friction, restitution] pair.
16 geoms gives ~50FPS on my pc. Can't do better atm.
Here it is simple brightness calculation:
- Code: Select all
Scene.my.min := (x)=>{x > 0.2 ? x : 0.2};
Scene.my.fl := (n, r)=>{0.1 + scene.my.min(n(0) * r(0) + n(1) * r(1)) / (r(1) * r(1) + r(0) * r(0))};
n - normal vector to geom surface
r - vector to light source
In that example I've store normal in [friction, restitution] pair.
16 geoms gives ~50FPS on my pc. Can't do better atm.
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
1 post • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests




