Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Specular is incorrect for isometric camera + direct light #2892

Open
1vanK opened this issue Apr 11, 2022 · 2 comments
Open

Specular is incorrect for isometric camera + direct light #2892

1vanK opened this issue Apr 11, 2022 · 2 comments
Labels

Comments

@1vanK
Copy link
Contributor

1vanK commented Apr 11, 2022

изображение

@1vanK 1vanK changed the title Specular must not know anything about position of directional light source Specular is incorrect for isometric camera + direct light Apr 11, 2022
@1vanK
Copy link
Contributor Author

1vanK commented Apr 12, 2022

@eugeneko

I think eye direction (cCameraPosPS - vWorldPos.xyz) must be the same for any point on the screen with the orthographic camera.

float spec = GetSpecular(normal, cCameraPosPS - vWorldPos.xyz, lightDir, cMatSpecColor.a);

@1vanK 1vanK added the backlog label Apr 12, 2022
@eugeneko
Copy link
Contributor

I've got me thinking... Yep, I think you are right.
Eye vector should be a vector from screen to object, which is the same as "cCameraPosPS - vWorldPos.xyz" for perspective matrix, but should be just "camera direction" for ortho.
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants