haolange / unity_screenspacelighting_old Goto Github PK
View Code? Open in Web Editor NEWLicense: Mozilla Public License 2.0
License: Mozilla Public License 2.0
Hello There.
Thanks for this awesome project. Learning much from this.
I had an issue today on a pc.
It would render black squares whenever the camera with this stack is on is enabled.
The Specs of the PC:
i7 5 series.
GTX 1080
It seems to happen in the tracing.
Strange is that it works perfectly on my pc with the same GPU
I just found out that this is old... but I came here to share a fix for SSR compositing.
At least in Unity 2019+, SSR is barely visible and the effect is unusable.
REPLACE the combine pass code in SSRPass.cginc (use search to find the file) with the following code.
////////////////////////////////-----CombinePass-----------------------------------------------------------------------------
half4 CombineReflectionColor(PixelInput i) : SV_Target {
half2 uv = i.uv.xy;
half4 WorldNormal = tex2D(_CameraGBufferTexture2, uv) * 2 - 1;
half4 SpecularColor = tex2D(_CameraGBufferTexture1, uv);
half Roughness = clamp(1 - SpecularColor.a, 0.02, 1);
half SceneDepth = tex2D(_CameraDepthTexture, uv);
half3 ScreenPos = GetScreenSpacePos(uv, SceneDepth);
half3 WorldPos = GetWorldSpacePos(ScreenPos, _SSR_InverseViewProjectionMatrix);
half3 ViewDir = GetViewDir(WorldPos, _WorldSpaceCameraPos);
half NoV = saturate(dot(WorldNormal, -ViewDir));
half3 EnergyCompensation;
half4 PreintegratedGF = half4(PreintegratedDGF_LUT(_SSR_PreintegratedGF_LUT, EnergyCompensation, SpecularColor.rgb, Roughness, NoV).rgb, 1);
half ReflectionOcclusion = saturate( tex2D(_SSAO_GTOTexture2SSR_RT, uv).g );
//ReflectionOcclusion = ReflectionOcclusion == 0.5 ? 1 : ReflectionOcclusion;
//half ReflectionOcclusion = 1;
half4 SceneColor = tex2Dlod(_SSR_SceneColor_RT, half4(uv, 0, 0));
half4 CubemapColor = tex2D(_CameraReflectionsTexture, uv)/* * ReflectionOcclusion*/;
half4 SceneColorMinusRefl = half4(max(0, SceneColor.rgb - CubemapColor.rgb), SceneColor.a);
half4 SSRColor = tex2D(_SSR_TemporalCurr_RT, uv);
half SSRMask = Square(SSRColor.a);
return lerp(SceneColor, SceneColorMinusRefl + SSRColor * PreintegratedGF, SSRMask);
//half4 ReflectionColor = (CubemapColor * (1 - SSRMask)) + (SSRColor * PreintegratedGF * SSRMask * ReflectionOcclusion);
//return SceneColor + ReflectionColor;
}
I'm getting this in 2019.3f5
A multisampled texture being bound to a non-multisampled sampler. Disabling in order to avoid undefined behavior. Please use Texture2DMS in the shader.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
PS:it looks gorgeous
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.