unity-renderer icon indicating copy to clipboard operation
unity-renderer copied to clipboard

Outline Shader Advance

Open MichaelBitsakis opened this issue 2 years ago • 16 comments

Shader info

THIS_ONE.webp

I0YKF.pngimages.jpg

HuntShowdownTrinity.png

MUST :

--> outlining alpha

--> control the online shape.

--> single solid color

--> or gradient outward

--> or it could also act as a mask for ultrarainbow color movement

--> rendered behind objects, and the inner mass of color may be faded with a overlay color mass when clicking, the effect may blink or change color.

MUST NOT -- DONTS

X : red lines: cant use duplication of geometry, and cant replace the geometry shader X : not based on geometry displacement

checklist


  • [x] Shader Base
  • [x] Specs
  • [x] Demo Scene
  • [x] outlining hull
  • [x] control the online shape.
  • [x] single solid color
  • [x] Script control
  • [x] Internal Fill
  • [x] rendered behind objects, and the inner mass of color may be faded with a overlay color mass when clicking, the effect may blink or change color.

-- GPU Skinning

  • [ ] Avatar Outline (GPU Skinning)

Extra Features To Add

  • [ ] outlining alpha (Later Upgrade)
  • [ ] or gradient outward (Later Upgrade)
  • [ ] or it could also act as a mask for ultrarainbow color movement (Later Upgrade)

MichaelBitsakis avatar Sep 26 '22 08:09 MichaelBitsakis

Advance Outline Progress

Technique : - Hull - Edge Scanned based Programming Language : URP HLSL (non CG)

Stage : Alpha

Progress Here

MichaelBitsakis avatar Sep 28 '22 16:09 MichaelBitsakis

Advance Outline Progress

Technique : - Hull - Edge Scanned based

Programming Language : URP HLSL (non CG)

Stage : Controls in Stable Mode / Project Implementation / Review

https://decentralandteam.slack.com/files/U040DBW2RFU/F044G76Q7MH/advance_outline_control-1.m4v

MichaelBitsakis avatar Sep 29 '22 16:09 MichaelBitsakis

Working on feedback adjustments

  • [x] Transparent objects issue (ZDepth related)
  • [x] Objects with open uvs
  • [ ] Multiple mesh objects

MichaelBitsakis avatar Oct 04 '22 11:10 MichaelBitsakis

For transparent objects that have problems solution is

  1. Add this transparent object to a Layer ( TransparentOutlined on my example here)
  2. Add those 2 render features that only apply on this layer

AddRenderFeatures-TransparentFix.jpg

MichaelBitsakis avatar Oct 04 '22 12:10 MichaelBitsakis

Coin issue is Overlapping UV's , cant be solved in the outline shader as we do calculations on that area of the shader. overlapping_uvs.jpg

I need to come up with another solution OR change the uvs of the coin

MichaelBitsakis avatar Oct 04 '22 14:10 MichaelBitsakis

We can keep the outlines connected by setting the Overlay Amount to 0 in such scenarios

MichaelBitsakis avatar Oct 04 '22 14:10 MichaelBitsakis

Transparency issue solved within the shader and the transparent material (use v2 shader and on the shader material disable the receive shadows)

MichaelBitsakis avatar Oct 04 '22 14:10 MichaelBitsakis

New Post Effect Core To URP (WIP / during translation) PostEffectCoreToURP.jpg

MichaelBitsakis avatar Oct 05 '22 12:10 MichaelBitsakis

Outline Replica from PostProcess to URP Render Feature

Current Features : Color , Width , Object Occlusion , Pseudo Blur

State : Wip , need to write the controls , clean it and stabilize the code. URP_Outline_PostProcessReplicaWIP.jpg

MichaelBitsakis avatar Oct 05 '22 15:10 MichaelBitsakis

Progress :

All cases EXCEPT CPU Skinning (Toon Shader) are working fine.

I will need some time to implement the outline to the custom GPU Skinning.! progress_1.jpg

progress_1.jpg

progress_2.jpg

progress_3.jpg

progress_4.jpg avatar_problem.jpg

MichaelBitsakis avatar Oct 11 '22 12:10 MichaelBitsakis

Shader based (per object without layers control) WIP progress. Based on the previous Render Feature version but in shader .

shader_based_per_object.jpg

MichaelBitsakis avatar Oct 17 '22 12:10 MichaelBitsakis

Finalizing this shader only approach with internal on/off feature flag

MichaelBitsakis avatar Oct 20 '22 07:10 MichaelBitsakis

Outline Combined Solution to a shader only setup

WIP on Avatar (on rest of the items works as expected)

Work in progress

https://images.zenhubusercontent.com/337227404/6de3d415-aed7-47d3-933d-f914a9c3fd5a/outline_combinedsolution_progress_1_1.m4v

MichaelBitsakis avatar Oct 20 '22 12:10 MichaelBitsakis

Progress 2 on Outline Avatar ,

More stable but i need to separate and use more passes to behave as we need it. Plus i need to separate objects from Avatar as i am forced to use different algorithms , again everything is going to be controlled from one shader only

Working on it.

https://images.zenhubusercontent.com/337227404/4c18cf36-a0c3-4974-bf88-958fd69614bb/outline_on_avatar_progress_2_1.m4v

progres_2_1.jpg

progres_2_2.jpg

MichaelBitsakis avatar Oct 21 '22 09:10 MichaelBitsakis

Implemented Outliner Straight into Toon Shader

Working GPU Skinning included (also in separate version)

Needs some tweaking to get the exact same look. Toon_With_Outline_Implementation.jpg

MichaelBitsakis avatar Oct 24 '22 11:10 MichaelBitsakis

  • Fixed glitch now as you can see in the video we have rock steady outline .

  • Unfortunately now we have partial transparency passing through the shader ONLY in camera view , so it probably a combination passes again , will find fix that one as well.

MichaelBitsakis avatar Oct 28 '22 12:10 MichaelBitsakis

Transparency coming through ALMOST solved!!!

transparency_passingthrough_progress_1.jpg

MichaelBitsakis avatar Oct 31 '22 12:10 MichaelBitsakis

Solved all issues with Toon shader , now it accepts the outline internally.

Some tweaks are left to complete this for the avatar .

Object outline needs some tweaking as well and its done.

OutlineToToon.jpg

https://images.zenhubusercontent.com/337227404/08ef9b50-da71-4a87-bd46-72f143e21396/toon_outline_merge_1.m4v

MichaelBitsakis avatar Nov 03 '22 12:11 MichaelBitsakis

Outline in Toon Shader

https://images.zenhubusercontent.com/337227404/217660a4-204f-4249-9658-114cd63c0d46/outline_in_toon_1.m4vr

MichaelBitsakis avatar Nov 04 '22 12:11 MichaelBitsakis

@MichaelBitsakis is everything ready for integration? Please ask @olavra to review when so.

xavi-dcl avatar Nov 14 '22 16:11 xavi-dcl

@xavi-dcl We need to review this with @olavra and do an integration with @AjimenezDCL .

MichaelBitsakis avatar Nov 14 '22 20:11 MichaelBitsakis

  • Outline on Avatar on single material
  • No extra work from Devs works as is.

outline_one_shadr.jpg

MichaelBitsakis avatar Nov 28 '22 10:11 MichaelBitsakis

  • Tested on wearables works_on_transparency.jpg

MichaelBitsakis avatar Nov 28 '22 10:11 MichaelBitsakis