Jump to content

Recommended Posts

Posted

I have founs some good articles :

http://en.wikibooks.org/wiki/GLSL_Programming/Unity/Toon_Shading#Outlines

http://sunandblackcat.com/tipFullView.php?l=eng&topicid=15

 

I wanted to modify diffuse shader to do the code below :

 


// higher priority: outline
	    if (dot(viewDirection, normalDirection)
		   < mix(_UnlitOutlineThickness, _LitOutlineThickness,
		   max(0.0, dot(normalDirection, lightDirection))))
	    {
		   fragmentColor =
			  vec3(_LightColor0) * vec3(_OutlineColor);
	    }

 

Does someone know what is viewdirection, normaldirection and lightdirection in LE3 ?

Stop toying and make games

Posted

That is writen for forward rendering..

 

view direction is your eye vector which would be in LE: normalize( modelvertexposition.xyz - cameraposition )

 

normaldirection should be ex_normal or computed normals with normals map.

 

lightdirection can't be fetched. or that is you can, but you need to calculate it in your app for 1 light and send it.

  • Upvote 1

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...