Wally869 / DirectionalSpriteShader

Shader created using shadergraph which implements billboarding and sprite selection from a spritemap according to the position of the camera and its angle
https://www.noveltech.dev/sprite-change-camera-direction/
MIT License
15 stars 2 forks source link

Correctly using shader #2

Open StatueTheShaman opened 2 years ago

StatueTheShaman commented 2 years ago

Using the 'Converting the Object-Space forward to World-Space' results in only 3 sides of the spite being viewed. I am wondering where does Normalize connect too? Thanks!

Torgo13 commented 2 years ago

This repo unfortunately doesn't have the changes mentioned in the second article: https://www.noveltech.dev/sprite-change-camera-direction-2/

I copied the two shader graphs using the images in the article. Getting the animation to work was simple. I just had to connect the output of the elapsed time to the X coordinate of the sprite selector (where the Y coordinate changes the viewing angle of the character).

However I haven't been able to get 'Converting the Object-Space forward to World-Space' to work. It outputs a Vector3 and I'm not sure where to connect it to. From the article it sounds like the shader graph for selecting the viewing angle of the character has been changed so there's probably a lot more I would need to modify.

@StatueTheShaman Could you show me a screenshot of your shader graph?