Use correct normal matrix

This commit is contained in:
Dane Johnson 2021-01-23 23:31:46 -06:00
parent 393b38499d
commit 3e816ae0d5
2 changed files with 17 additions and 2 deletions

View File

@ -58,3 +58,19 @@ I'm a bit happier with the system now, I think it's time I started the lighting.
We're going to use a pretty basic Phong lighting system, with We're going to use a pretty basic Phong lighting system, with
Flat and Garourd shaders available (This was all that was available on the PSX!) Flat and Garourd shaders available (This was all that was available on the PSX!)
## Bump in the road (1/23/21)
Not sure where to go next. I changed to using OBJ files for meshes, which I might need
to revert (shitty animation support). There are a number of systems I want to add next
- GUI (dearimgui or Nuklear) (Maybe expose a raw opengl context for these?)
- Physics engine (Bullet)
- Animation system
- General code cleanup
- Scene editor
- Rest of lighting engine (point lights, spotlights)
- Audio engine
## Physics
Yeah sure let's do physics
- [ ] Static, Kinematic and Rigidbodies
- [ ] Collision areas
- [ ] Ray tracing

View File

@ -46,8 +46,7 @@ void main() {
UV = uv; UV = uv;
vec3 my_normal = (VIEW * MODEL * vec4(normal, 0.0)).xyz; vec3 my_normal = (VIEW * mat4(NORMAL) * vec4(normal, 0.0)).xyz;
my_normal *= NORMAL;
// Flat shading, we compute light per vertex // Flat shading, we compute light per vertex
AMBIENT = directionalLight.ambient * directionalLight.color * material.ambient; AMBIENT = directionalLight.ambient * directionalLight.color * material.ambient;