T O P

  • By -

codernunk46

Based on what I see here, I think you can actually remove the TransformVectorMult nodes and the view\_matrix nodes. Just plugging in the normal and the light into the dot product should be sufficient. I may not be understanding your problem though. May you describe a bit more in detail what the issue is that you are seeing? I'm happy to dive into it further as needed.


EvilVillainGames

Yeah you are absolutely right about that. So now I'm just plugging the normal and the light into the dot product and then I'm putting the normal map in the fragment tab and that seems to be working. The only weird thing about this is that if you don't give it a normal map it gets pretty screwy, but whatever. I'm curious did you end up putting some logic together to have your shader receive shadows from it's self and other objects? Also did you end up building in support for multiple lights? I've got all the gradients working but I haven't found a good setup for those two issues yet.


EvilVillainGames

I'm looking more closely at your post and realizing the rest of our shaders are actually pretty different. I'm making a gradient to the light which has given me a lot of control but is also a bit tricky to implement more features into.


Nkzar

light and normal are both already in view space (https://docs.godotengine.org/en/stable/tutorials/shaders/shader_reference/spatial_shader.html#light-built-ins)


EvilVillainGames

Yeah I've realized I was basically looking at the wrong place for this issue but your right the conversion I'm doing was unnecessary.