Comments (4)
Hey Den, this is caused by some issues with the view direction. The line below helps to influence the strength of the depth buffer, by increasing the amount of depth required on sharp edges (see section 3. Resolving surface artifacts of the tutorial).
float NdotV = 1 - dot(viewNormal, -i.viewSpaceDir);
Unfortunately, in ortho mode, as the projection is parallel, viewSpaceDir does not correctly work. This can be resolved by replacing the line with
float NdotV = 1 - dot(viewNormal, float3(0,0,1));
Where the view direction to each vertex is directly forward.
There's still some missing edges, such as along the teapot's rim, but those could be fixed by tweaking the parameters I'd assume. The above is using the default settings, except Depth Threshold is set to 0.01.
from unityoutlineshader.
Thank you for help!
Tried your solution but seems did not really work well for me. Still have missing edges on stairs and other.
Set Depth Threshold to 0.01 helps for better result.
Also found but did not tried yet other solution also based on normal map.
https://gamedev.stackexchange.com/questions/68401/how-can-i-draw-outlines-around-3d-models
from unityoutlineshader.
Are you making sure to run the scene in Play mode? This ensures that the normals buffer is rendered out and is accessible.
from unityoutlineshader.
Yes, run in Play mode.
from unityoutlineshader.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unityoutlineshader.