Giter VIP home page Giter VIP logo

Comments (4)

IronWarrior avatar IronWarrior commented on June 30, 2024

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.

image

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.

oden3d avatar oden3d commented on June 30, 2024

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.

IronWarrior avatar IronWarrior commented on June 30, 2024

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.

oden3d avatar oden3d commented on June 30, 2024

Yes, run in Play mode.

from unityoutlineshader.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.