osre icon indicating copy to clipboard operation
osre copied to clipboard

When no texture is loaded the light calculation is wrong

Open kimkulling opened this issue 2 years ago • 1 comments

Describe the bug When a loaded model does not have any textures the texture calculation gets wrong.

To Reproduce Steps to reproduce the behavior:

  1. Load obj box without texures
  2. Check render result

Expected behavior Lightning applied

Screenshots image

Desktop (please complete the following information):

  • OS: All

Additional context N/A

kimkulling avatar May 11 '23 18:05 kimkulling

Seems that we need to do the calculation of phong in the fragment shader: https://stackoverflow.com/questions/55778950/how-to-combine-texture-and-lighting-in-opengl

kimkulling avatar May 11 '23 18:05 kimkulling