Corgi God Rays - Volumetric Lighting for URP [RELEASED!]

Is there a demo where I can fly around? Would like to asses the quality in other situations. First person camera, Large distant objects, Top-down, Flight Sim, etc.

I haven’t tried the deferred renderer yet, but it probably does work. I’ll try it out later and let you know. As for the 8 light limit, that actually does not apply to my plugin (anymore). The godrays have an internal limit of 128 lights, but this is arbitrary and could be raised if requested.

@funkyCoty
Hi - adding the RenderFeature turns on a default god ray on all scenes, regardless of whether that scene contains a volume or not. Is there a way around this, so only scenes that have any god rays are ones where a volume has been manually added?

I may be wrong, but I believe Unity/URP does not currently provide a way for developers to easily query if a volume system has a particular volume component. The way developers query the stack it always returns a volume with some default values. So, I think your best bet for now is to simply add it to all your volumes and use the overrides to turn the settings down to 0.

I’ll try to improve this in a future version so that if no volumes have settings for it it’ll just be off by default.

Update just pushed to the asset store!

Currently working on an update, squeezing out some more performance by playing around with temporal stuff.

Trying to build to quest 2 using Vulkan, URP 12.1.6, Unity version 2021.3.14, and getting this error. When I double-click the error it goes to line 82 in “Hidden/CorgiGodRays/ApplyGodRays” shader. Any help would be great.

Shader error in ‘Hidden/CorgiGodRays/ApplyGodRays’: ‘Sample’: no matching 3 parameter intrinsic method; Possible intrinsic methods are: Texture2DArray.Sample(SamplerState, float3|half3|min10float3|min16float3) Texture2DArray.Sample(SamplerState, float3|half3|min10float3|min16float3, int2) Texture2DArray.Sample(SamplerState, float3|half3|min10float3|min16float3, int2, float1|half1|min10float1|min16float1) Texture2DArray.Sample(SamplerState, float3|half3|min10float3|min16float3, int2, float1|half1|min10float1|min16float1, out uint status) at line 82 (on vulkan)
Compiling Subshader: 0, Pass: , Vertex program with DEPTH_AWARE_UPSAMPLE GODRAYS_ADDITIVE_LIGHTS GODRAYS_ENCODE_LIGHT_COLOR GODRAYS_MAIN_LIGHT INSTANCING_ON LIGHTMAP_ON STEREO_MULTIVIEW_ON _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS_CASCADE _SHADOWS_SOFT
Platform defines: SHADER_API_MOBILE UNITY_ASTC_NORMALMAP_ENCODING UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_RGBM_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3
Disabled keywords: DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_COLORSPACE_GAMMA UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS_VERTEX _CLUSTERED_RENDERING _MAIN_LIGHT_SHADOWS

You’re trying to run a volumetric lighting plugin on Quest 2? Lol sorry, even if I resolved this error for quest I think you’d find that it would be unacceptably slow. You cannot even have shadows in most quest games, let alone trace through them in real time on quest for volumetrics.

This doesn’t seem to be working in Unity 2022.2.11

Thanks for letting me know. Do you have any errors on hand? I’ll look into it this weekend hopefully.

Hey, I just sat down to take a look at this, but it seems to be okay in Unity 2022.2.11f1, for me? If you have any errors please share them with me here, and I’ll take a closer look as soon as possible.

8902890--1218267--Unity_le497GrDDD.jpg

Hey @funkyCoty . I’ve just purchased the package. There are several obsolete functions being used, mostly I have resolved but the final one I don’t know how to proceed with is this one:

Assets\CorgiGodRays\Scripts\GodRaysRenderPass.cs(261,30): error CS0618: 'RenderingUtils.fullscreenMesh' is obsolete: 'Use Blitter.BlitCameraTexture instead of CommandBuffer.DrawMesh(fullscreenMesh, ...)'

This appears several times after importing the project, all in GodRaysRenderPass.cs
I’m on Unity 2022.2.18f1 URP 14.07

My project is setup in a way where usage of obsolete methods won’t let other scripts compile, so I can’t really use the package. Do you have a workaround I could apply or a new version cooking up? If so when do you expect it to be available? Cheers!

Hey. I’ll take a look this weekend. I really wish Unity would quit pushing breaking changes every version, haha.

Got a chance tonight to look at this. I went ahead and pushed a fix for Unity 2022+

1 Like

Darn… the update posts are all broken after the recent forum migration.

I just bought this asset. I tested on 2022.3.48f.
Here are a few things that I learned that aren’t mentioned anywhere.
The effect does not work correctly on OpenGLCore. So make sure to use Vulkan on Linux. I don’t know about other platforms.
Volumetrics are not visible for Additional Lights with Forward+. Forward and Deferred works as expected.

Do you plan on updating this asset to work with RenderGraph?

I’ve gotten this question a few times now so I’ll look into if its feasible soon.

1 Like