File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,15 @@ void OnEnable()
6767 return ;
6868 }
6969
70+ CleanupBuffer ( ) ;
71+
7072 // Disable the image effect if the shader can't
7173 // run on the users graphics card
72- if ( ! shader || ! shader . isSupported )
74+ if ( shader && ! shader . isSupported )
7375 {
7476 enabled = false ;
7577 return ;
7678 }
77-
78- CleanupBuffer ( ) ;
7979 if ( buffer == null ) ApplyBuffer ( ) ;
8080 }
8181
@@ -88,7 +88,6 @@ private void OnPreRender()
8888 void OnPostRender ( )
8989 {
9090 TargetMeshes . Clear ( ) ;
91- Shader . SetGlobalTexture ( "SSSMaskTexture" , null ) ;
9291 }
9392
9493 public struct SSSParameter
@@ -246,7 +245,7 @@ void CleanupBuffer()
246245
247246 public void AddMakeSSSMaskCommands ( CommandBuffer buffer )
248247 {
249- if ( ! Camera . current || TargetMeshes . Count == 0 ) return ;
248+ if ( TargetMeshes . Count == 0 ) return ;
250249
251250 for ( int i = m_MaskMaterials . Count ; i < TargetMeshes . Count ; i ++ ) {
252251 if ( maskShader != null ) {
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ void OnWillRenderObject()
3737 {
3838 if ( r ) {
3939 var camera = Camera . current ;
40- var sssssMain = camera . gameObject . GetComponent < CP_SSSSS_Main > ( ) ;
40+ var sssssMain = camera . GetComponent < CP_SSSSS_Main > ( ) ;
4141 if ( sssssMain && sssssMain . isActiveAndEnabled ) {
4242 if ( Application . isPlaying ) {
4343 for ( int i = 0 ; i < subMeshIndicies . Count ; ++ i ) {
You can’t perform that action at this time.
0 commit comments