A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by techsalad, Oct 9, 2017.
Thanks for the response, yes that is a feature i need so I can
use this for a 2d game I’m making.
So I had a quick look at it and it's actually pretty easy to implement. I already have a working prototype
So I could definitively add this feature in the next update.
If you are interested in receiving a WIP version before to try it, send me an email at firstname.lastname@example.org with your invoice ID, I will be happy to share it with your ASAP.
Thank you so much!
I purchased yesterday your great asset. Some how I couldn't find out how to change the size of the cone base of the light. I created a volumic spotlight for a my Flashlight but some how the light has more a shape of tube rather than a cone., which could be ok for me, the only problem is that the base is much more bigger than my flashlight.
I can show a screenshot later if u need.
Hi and thanks for your message,
You can customize the shape of the beam using 2 properties:
- Truncated Radius allows you to change the size of the base of your beam. Tweak this one to make it fit with your flashlight model: http://saladgamer.com/vlb-doc/comp-lightbeam/#truncated-radius
- Spot Angle allows you to change the shape of the beam, to make it look more like a cone or more like a tube: http://saladgamer.com/vlb-doc/comp-lightbeam/#spot-angle
Do not hesitate if you have more questions.
thanks a lot... will try it later....
are you able to do circle volumetric lights?
If by "circle" you mean supporting "point lights" (light going in every directions in 360 degrees), no. The plugin only supports spotlights.
yes I mean point lights will you support it in the future?
This is not planned: it's not really possible with the current technique the plugin is using.
For example doing volumetric point lights without supporting shadowing doesn't make a lot of sense (otherwise it's just a big glow). And supporting shadowing would involve a much more performance intensive process, which would not run on mobile for example.
ok thanks for the reply
When compiling for PS4 I get errors in the Beam shader (the first one in both frag and vert):
Shader error in 'VolumetricLightBeam/Beam': Program 'frag', 'sampler2D' does not contain a member named 'Sample' at /Unity/2018.1.0f2/Editor/Data/CGIncludes/HLSLSupport.cginc(519) (on ps4)
Compiling Fragment program with STEREO_INSTANCING_ON VLB_DEPTH_BLEND
Platform defines: UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING
Shader error in 'VolumetricLightBeam/Beam': undeclared identifier 'sampler_CameraDepthTexture' at Assets/Plugins/VolumetricLightBeam/Resources/VolumetricLightBeamShared.cginc(49) (on d3d11)
Compiling Vertex program with STEREO_INSTANCING_ON VLB_DEPTH_BLEND VLB_NOISE_3D
Platform defines: UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING
I'm on version 1320 and using Unity 2018.0.1
I don't have a PS4 devkit to try, but we'll find out the issue. Have you tried to update to the latest 1520 version?
No I haven't, for the simple reason that the game is already out on PC and I don't want to update stuff that works... I'll give it a go and see if it the issue is resolved.
I've discovered something weird.
the light is going through every surface. first I discovered through a character, then I added a box behind the character and I had the same effect, the light is going through the character and the box. and I'm sure I didn't have the same effect prior adding the volumetric light.. please see the picture below:
The VolumetricLightBeam component is not supposed to change the behavior of the light itself. You can try to disable or remove the VolumetricLightBeam component (and the DynamicOcclusion component) to check if the issue is still the same without them.
Please let me know,
Just been through the forum to see if there's talk of a rectangular beam (which I see there is plenty) - great that it's on its way
In the meantime, I found putting the cone segs to 4 gives you a square beam with the only downside that it is created at 45 degrees so you can't use local scale to create a rectangle.
Now, if this cone was created with this rotation in mind, I'd have the kind of solution I'm looking for... (window light beams).
Plugin otherwise is really great! Thanks
You are right, you can make a kind of rectangle beam this way. However I think the quality is not satisfying enough to "sell" it as a real feature. Making rectangle beams with a good quality is not as easy as it sounds, and is in fact quite different than making cone beams.
However, if it helps you, I could definitely make the beam geometry rotated by 45 degrees by default so you could scale it properly. If you are interested in testing it beforehand, please send me an email at email@example.com
Hi, are you able to round out the point of the cone? I'm using this for 2D
What do you mean? Do you mean having a half-sphere at the point of the light source like that?
Yes, thanks for the reply.
No it's not possible to do that.
But you should be able to do it by just adding a half-sphere mesh at the light source position.
Can you give me an example of how to do that?
I will try to make you a scene example. I will contact you by private message.
Just purchased the asset and had a go but I am experiencing some issues.
1. When I set it up in he editor, it all seems to be fine, but when I am in play mode, it seems like the drawing of the beam seems to be weird. It becomes very short and possibly not even drawing the outter pass. In order to view the beam, the only way is to click on the global button and then toggle the "force single pass" check box on or off. It doesn't matter if it is on or not, as long as I click on that check box.
2. Track changes during playtime - This doesn't work for me. If I turn the play mode off, the values all just go back to what it was before I was in the play mode.
3. This is probably my fault of not reading the manual before I buy the asset, but partial occlusion was no good for my usage case.
I am using : Unity 2018.3b12. Windows Editor. Linear, Deferred. HDR.
I am really sorry for the issues you are experimenting:
1. That is very weird. Are you using a custom SRP, or the default render pipeline (https://blogs.unity3d.com/2018/01/31/srp-overview/ )? Have you tried to export a Windows standalone build to check if the issue is visible?
I will try to install the exact same Unity version and try to reproduce it. In the meantime, if you can send me your project (or a subset of it) so I can reproduce in better conditions, please not hesitate: firstname.lastname@example.org
2. Sorry if it wasn't clear, but this feature is designed to change the volumetric light beam properties at runtime (from script, or from an animation for example). It's not to keep the changes you have made in editor when playing. I hope it makes sense...
However I think this is a very interesting suggestion, and I will definitely investigate to make it.
3. Like mentioned in the documentation and the asset store page in the limitation part, partial occlusion is not supported yet indeed.
I am using just default rendering pipeline.
As for the tracking changes during playtime, I am sure it must been mentioned somewhere in the document so it is not entirely your fault, but I bet 9 out of 10 people would think it is supposed to be for the inspector .. haha!
I need something like this for 2D project - I need exactly lightposts, don't you know :] Does Volumetric Light Beam work in 2D as well?
Hi and thanks for your interest
Yes it works in 2D. You can customize specific 2D properties like Sorting Layers and Order in Layer, like a regular 2D Sprite: http://saladgamer.com/vlb-doc/comp-lightbeam/#2d
OK then, you'll have a new customer soon then :]
hi this looks great, I am wondering if I can fake sun-shafts with this somehow, I work in VR so true volumetrics are off the table, which makes this the perfect way.
a good example can be the light shafts at the top of this image.
Hi and thanks for your interest. Simply put, no it won't work. The asset is mainly design to simulate volume on spot lights. The result won't be good to simulate directional light like that.
Can't we use the noise texture within the beam? to fake directional light coming to the trees?
Just now the noise is uniform, it needs to be directional
It won't look good I think.
The current 3d noise effect looks good because it's "random" noise and because the noise intensity is usually not too high. If you make the noise pattern more obvious and with higher contrast, the cone shape of the beam will be too visible.
What you are asking is basically the same than doing the cookie feature: having a "controlled" noise pattern with higher intensity. So it might be possible to have a similar effect with the cookie feature, but since I'm not 100% sure, I prefer not to give you false hopes!
Yes like a light cookie, Im also interested in that, how is that progressing?
Well it's a challenge... I am currently more focused on current performance improvement and on fixing stuff because of API changes in unity such as keeping support of HDRP, LWRP and VR. I am preparing a big update all about drawcall decrease btw, should be released next week.
But once it will be fine, I will be able to focus more on this long awaited feature!
I am extremely pleased to announce the release of Volumetric Light Beam 1.60.
The main feature of this new update is GPU Instancing, a major optimization for high-end devices to draw hundreds of beams in 1 single drawcall. Learn more about this in the new Optimization page of the documentation.
You can now download a Windows PC and Mac OSX demo in addition to the Android and WebGL builds on this page.
New GPU Instancing feature: dynamically batch multiple beams to combine and reduce draw calls.
Change the Force Single-Pass Config's property to Rendering Mode property.
Dynamic Occlusion is now fully compatible with 2D objects: a 2D sprite can occlude volumetric light beams.
Now properly supports mirrors and reflections using render-to-texture camera with oblique near-plane projection matrix.
Hope you'll like it!
Version 1.61 of the plugin has been released.
It's mainly about improving compatibility with latest SRP updates (4.0.0 or higher). When using the previous 1.60 version, the beams could have some unwanted artifacts visible. This is now fixed, but it requires some minor configuration: everything is explained in the documentation here.
Improve SRP support when using HDRP or LWRP version 4.0.0 or higher.
Rename beam's Alpha properties to intensity.
Beam's intensity can now be binded to Unity's spotlight intensity property.
Square beams (beams with 4 sided geometry) are now properly oriented.
Hello, I just sent an e-mail regarding light beams becoming pink after importing a scene with light beams. Followed the solution to delete VLB folder entirely, and re-import. It worked. For some reason it didn't work in a new project, but it did fix the problem in the existing project. Just posting here to let you and others know.
Thanks you very much for sharing this. I am glad you managed to fix your problem. Unity's asset import process is sometimes a bit buggy...
Hi, is there a way to add more rays to the dynamic occlusion?
Currently it performs 4 raycasts, and this is not editable.
Why would need more rays? Is it because some parts of your beam are intercepting with some geometry, but the rays don't catch it?
Hi, whenever I start up the game on iOS I get this error printed to the log.
The referenced script (Unknown) on this Behaviour is missing!
The referenced script on this Behaviour (Game Object '<null>') is missing!
A scripted object (script unknown or not yet loaded) has a different serialization layout when loading. (Read 64 bytes but expected 3552 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
Thank you for notifying me this issue. I've never heard of it, but I will investigate. Would it be possible to provide me as many information as possible please:
- Unity version
- Windows or Mac?
- iOS version and device model
So you can export your project fine to iOS, but this issue is raised when you try to execute it on the device?
Does it work if you run it in the editor, or on other platform (PC, Android)?
This happens only on the ios device (iphone x, latest ios version), not when running it in the editor on mac or windows.
Errors like these can be related to other scripts though, I've seen it happen before - so there is a small chance that this is not related to the stack trace at all.
But, with that being said: I see that the VLB code has a habit of mixing UnityEditor specific code inside the MonoBehaviours. This is a really bad practice and you should not do this. Create separate Editor classes for your editor code to get better code separation (and hopefully get rid of errors like the one I am seeing).
Don't do this sort of thing in scripts:
I hope to see the asset updated
So I tried to reproduce the issue with several Unity versions and on several iOS devices but I couldn't. Do you think it would be possible to share with me your project (or at least a subset of it)? If yes, please contact me via the support email: email@example.com
Regarding your comment, have you tried to remove the editor only code in Config.cs to try if it works?
I doubt it would, because AFAIK it's not recommended to serialize properties only with UNITY_EDITOR enabled. But having editor only logic or functions is fine. I totally agree that all the editor code should not be mixed with MonoBehaviours classes, and in the plugin most of the editor code is in separate classes/files.
But if you need a very specific behavior to be executed only in editor and not in standalone builds, I personally thinks it's more convenient and cleaner to have some scarce UNITY_EDITOR logic code in the MonoBehavior.
If you want, I could try to make you a custom version without any UNITY_EDITOR code in MonoBehavior classes to validate if the issue comes from that or not.
Anyway please let me know.
Quick note to say that on LWRP 4.9 you need to tick in the LightweightRenderPipelineAsset Depth Texture and... Opaque Texture as well.
Otherwise the asset seems to work great! Well done.
Thank you very much for notifying this info. I will update the documentation about it.