slightlymad / volumetriclights Goto Github PK
View Code? Open in Web Editor NEWVolumetric Lights for Unity
License: BSD 3-Clause "New" or "Revised" License
Volumetric Lights for Unity
License: BSD 3-Clause "New" or "Revised" License
The fog from directional light and point lights just not appears in the standalone build.
Screenshot of the console after build.
Windows 10 (x64), Unity 5.5.1.
It's quite confusing that the asset package has no problem, it runs well both in unity editor and
built application.
But when I import the asset to my own project, everything seems ok in unity editor,
then I built a PC package.
All volumetric light effects disappeared.
I think maybe there is something wrong with my settings in unity.
I'm using 2018.3.9
It seems that RenderTextures render the textures a bit darker than they should, as you can see in the screenshots. Is there something I might be doing wrong or is this a bug?
Scene with the VolumetricLightRenderer enabled: (you can see where the RenderTexture is, even though both sides of that visible line should be completely white)
Scene with VolumetricLightRenderer disabled: (you don't see where the normal object stops and the RenderTexture continues because both are completely white)
Not rendering at all, can't explain, sorry.
Here are the errors that shows:
Invalid pass number (10) for Graphics.Blit (Material "(Unknown material)" with 1 passes)
Invalid pass number (2) for Graphics.Blit (Material "Hidden/BilateralBlur" with 1 passes) UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32) VolumetricLightRenderer:OnRenderImage(RenderTexture, RenderTexture) (at Assets/Volumetric Lights/Assets/Scripts/VolumetricLightRenderer.cs:337)
Like the title says, if you're using orthographic projection to achieve an isometric look, even if you update the projection matrix in the code, nothing will be rendered to the render texture unless the near clipping plane is an extreme negative value.
This issue can be observed in the example scene.
Hello!
I'm having an issue that to be quite frank i've been having virtually in all assets of volumetric lights, atmospheric scattering, height fog, global fog, volumetric fog etc...
The effect works great, however whenever there are no shadows being casted near the camera, the effect disables itself entirely.
Just wanted to know if this is intended behaviour (and by extension intended behaviour of all volumetric effect assets), or if i'm just doing something terribly wrong or anything I might be missing for the proper scene setup, or maybe even if there's something wrong with my GPU drivers.
The lights are great but in VR (with an HTC Vive), they are somewhat shifted from the original position in both the right and the left eye but on different positions depending on the eye.
Can you build the package so i can put it in my project please?
As the title says no error no warning but doesn't work anymore
Also using Lightweight render pipeline. Might be the issue.
Using the lightweight render pipeline 1.1.2 installed from the package manager is confirmed the issue.
I don't know what's wrong there is no warning or error but the lights are for sure non volumetric now.
hi dear,
any chance to provide URP version??
I tried but received this message:
Invalid pass number (2) for Graphics.Blit (Material "Hidden/BilateralBlur" with 1 passes)
UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32)
VolumetricLightRenderer:OnRenderImage(RenderTexture, RenderTexture) (at Assets/Scripts/VolumetricLightRenderer.cs:337)
The effect can also be seen easily by pausing the editor and resizing the game view window. Its really washing out any screencapture I take.
Objects turn dark when they are at the opposite side of the light source.
Here's everything looking fine (the light source is pointing at the camera):
The building is lit perfectly, but the terrain in the background is darkened (the camera is turned 180 degrees):
If we get farther from the building, we see it turning black:
This is how everything should be lit. No dark areas or shadows.
Invalid pass number (1) for Graphics.Blit (Material "Hidden/BilateralBlur" with 1 passes)
UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32)
VolumetricLightRenderer:OnRenderImage(RenderTexture, RenderTexture) (at Assets/VolumetricLights/Scripts/VolumetricLightRenderer.cs:354)
I'm having an issue where the effect kind of "blinks" on shortly after my player camera spawns. Is there a way to force the effect on as soon as the camera is instantiated? Or is this a know issue / something is wrong with my setup? Thanks.
Volumetric fog does not display in windows build, but it displays in player. Unity 5.6.1f1
@SlightlyMad
If i have shadows enabled for the spotlight, and it doesn't hit any objects, the light stops rendering / turns invisible if viewed from certain angles.
This can be recreated in the spotlight scene, if you rotate the light upwards, then move the camera and the light upwards, at one point it will stop rendering the light, seems like range has something to do with it as well.
Is this a known issue or something new? The rendering's values seems to stay the same, so I couldn't debug it any further.
Using 2017.3.1f1!
edit: read the description and now I feel like a proper dummy
Hi,
I have been using this Unity extention and it's great! But I came across one problem. To avoid gun clipping I have added second camera that draws only player and gun.
So my main camera has depth -1, and my gun camera has depth 1. With that I cannot see cone or any lightning effects. I alo can't add renderrer script to gun camera since it does not render walls.
Is there a way to bypass this problem or should I try different way to fix gun clipping?
Save a bunch of GPU memory, set the 3D texture format to A8. When sampling the texture, be sure to do a .a, i.e.
tex3Dlod(noiseTexture, float4(x,y,z,-999.0)).a
Hi,SlightlyMad.
I've been testing this project on a PS4 console.However,there were tons of problems showed up.I managed to handle some of them by converting
float4 centerColor = _MainTex.Sample(sampler_MainTex,uv);
into
float4 centerColor = UNITY_SAMPLE_TEX2D(_MainTex,uv);.
Solved Problems(Image Below):
But there are still some issues that drive me mad.(Image Below):
I can sense that the problems are caused by PS4 sampler state,sort of.But I can't get any answer or information on the web.
Would you please give me some hints?
Much appreciated.
BTW,sorry for my poor English.(^_^)
So lets say I have a point light or spot light somewhere with a volumetric light.
This light will have a shadow strength of something less than 1, let's say 0.7;
Now I add a second light with a volumetric light. This one will have a strength of 1.
The second light's volumetric shadow now behaves like it has the shadow strength of the first one.
Also changing the strength of the first light now affects both volumetric lights.
So basically the volumetric lights take the lowest shadow strength of all volumetric lights that are available and uses it for all volumetric shadows in the players view.
It happens with both spot lights and point lights.
Maybe the shader wasn't meant to run on the XBOX One. But I just wanted to inform that it gives this error ["Invalid pass number (1) for Graphics.Blit (Material "Hidden/BilateralBlur" with 1 passes"] when run on the xbox one ...
When you resize the window in editor while playing the fog intensity goes up exponentially until the screen is white. Also happens when you hit pause.
this is it :
Invalid pass number (1) for Graphics.Blit (Material "Hidden/BilateralBlur" with 1 passes)
UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32)
VolumetricLightRenderer:OnRenderImage(RenderTexture, RenderTexture) (at Assets/Volumetric Light/Scripts/VolumetricLightRenderer.cs:363)
I'm using Unity5.6.7
any help ?
Hi! I'm getting these 2 errors in Unity 2017.1.1.f1:
And I don't know if this is related to me, using a newer engine version, or just a bug...
Thank you! :)
Playing with this volumetric lighting in a project of ours - looks absolutely brilliant, except of course for transparent geometry which looks like it's being rendered later. Is it just a matter of twiddling the shaders' render queues (which I can't seem to do in unity with these compiled shaders), or is there something more fundamental going on?
You can see in this image the water (black bits) seems to be being rendered after the volumetric effect, which is a shame.
Hi Michal,
Nothing is rendering in 2019.1 - no errors being thrown, shaders are all compiled, the command buffers are still there, and there's nothing in the 2019 release notes that gives me any hint as to what might've changed to stop this brilliant effect working.
Any guesses?
Hey I love your asset it looks great. Unfortunately it doesn't show up when I do a build of the project.
I moved all the shaders and the text asset that contains the dds file to the "Resource" folder so it can find it when it builds.
(shaders that are included via Shader.Find() don't get automatically added to the build)
But although there are no longer any error messages the fog still doesn't show up on the build, however it works fine when i play in editor.
[Error] Invalid pass number (2) for Graphics.Blit (Material "Hidden/BilateralBlur" with 1 passes)
VolumetricLightRenderer.OnRenderImage() Assets/Plugins/VolumetricLightsSlightltyMad/VolumetricLightRenderer.cs:345
344: // horizontal bilateral blur at half res
-->345: Graphics.Blit(_halfVolumeLightTexture, temp, _bilateralBlurMaterial, 2);
347: // vertical bilateral blur at half res
When applying the current Unity Stack image effects and enabling fog settings within the lighting settings, the volumetric spotlight beam will appear under the fog as in rendered behind the fog. When disabling fog in lighting panel, the volumetric light is rendered correctly.
Screenshot: http://imgur.com/NLetlTd
Hi,
Is there a way to add no fog zones in the shader code?
We currently are running some tests, using the height fog as some kind of mist in our scene, and we want one of the character skills to remove some of the mist. The problem is that the skill is done away from the player, and he can move close or away from that zone.
We know it is possible with Ray Marching to add primitive(s) to the calculation and wondered if you would know where in the code we should be looking in order to achieve what we want?
We don't know if that will look realistic but we want to try it ;p
Cheers!
Hi. I have used your asset in the development of my game since Unity 5.4. Now, I am moving to HD Render Pipeline, and I can't get your asset working.
What should I do?
Thanks.
I've done some investigation.
Shaders have been explicitly included in the build.
The problem exists in Unity 5.5 as well as newer version. Tested multiple Unity versions upto 2018, starting at 5.5
The problem only occurs in standalone builds and not in the editor.
The problem seems to be the RayMarch function in VolumetricLight.shader returns black with alpha set to 1 for the entire screen.
Materials using certain shaders, transparent shaders in particular, aren't affected by volumetric lights the way others are. In the attached example, you can see that the decals on the wall remain dark, as does a portion of the oil lantern (front left). These using Legacy Shaders/Transparent/Diffuse
and Standard Fade
, respectively.
Edit: it seems to be related to render queues. Decreasing the render queue for the affected materials seems to fix the issue. I'm wondering if the render queue for the VolumetricLight
shader is set too low, though? The issue happens with quite a few default shaders, out-of-the-box. (Unity 5.60f3, FYI)
Hi,
first of all thanks very much for this great stuff!
Here´s my issue:
I use a directional light (Realtime mode) as a sun for my outdoor scene.
I setup the VoluemticLighting component on this light to get some nice godrays using realtime shadows.
I see everything is fine in runtime.
I switch this light to Baked mode for baking some lightmaps.
I switch this light back to realtime mode but the godrays are no longer present in runtime.
I clear baked data and godrays are present again.
Any ideas?
Kind regards,
Carsten
Will this be fixed? We do not have enough good light in a small asset =(
I'm getting this error every frame:
Dimensions of color surface does not match dimensions of depth surface UnityEditor.DockArea:OnGUI()
(also this plugin is amazing. Seriously incredible results)
Hi again :)
Lights seem to not render in some of the newer macOS versions at all, is this a known issue?
Using Unity 2017.1.1f
Editor
https://imgur.com/jWSUuDI
Building the project
Not sure what the issue is
On unity 5.0.0, VolumertricLight.cs throws an error: Light doesn't have addCommandBuffer()
For some reason, In one specific scene, the light just goes like "yeah, i'm not gonna be volumetric" and just fails, leaving a shitstain of disappointment on my entire project, Thinking it my be a problem with my version of unity, i opened an example script and it worked fine. i did literally the exact same things as in the example, and it still doesn't want to work.
edit: oops i fixed it. the range of the light was too goddamn bigg.
please do it!
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.