TheOverfloater / pathos-public

Public release of Pathos Engine
MIT License
42 stars 10 forks source link

how would i get viewdir in shaders? #36

Closed valina354 closed 4 months ago

valina354 commented 4 months ago

i want to add parallax occlusion mapping to engine, i have tried 5 times already based on this https://learnopengl.com/Advanced-Lighting/Parallax-Mapping but i dont know how i would get viewdir, everytime i have tried it was broken due to broken viewdir, only thing i found is ps_vertexpos but that doesnt seem related

valina354 commented 4 months ago

i tried to do this for parallax mapping but it results in this trippy broken effect image image which i guess is caused by wrong view dir as everything else seems fine

valina354 commented 4 months ago

i tried to do this similar to learnopengl parallax mapping thing it shows but still, bit less broken but still image image

it breaks a lot when getting further from the brush but still broken close and with less parallax depth image @TheOverfloater

valina354 commented 4 months ago

decided to try normal parallax mapping and it seems better then parallax occlusion mapping interms of working but still not working fully image image

valina354 commented 4 months ago

this closest im getting but still broken which is pretty much 99% related to the viewdir image image

valina354 commented 4 months ago

i somehow got it working this way so nvm image image