Search Unity

True Volumetric Lights (Now Open Source)

Discussion in 'Shaders' started by Michal_, Mar 10, 2016.

  1. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    And the update is live. See Readme and example scenes for more information.
     
  2. Dreamaster

    Dreamaster

    Joined:
    Aug 4, 2014
    Posts:
    148


    Oh yes... this IS FANTASTIC... :) Thank you so much for making this available!
     
  3. chilton

    chilton

    Joined:
    May 6, 2008
    Posts:
    478
    Oh that is impressive
     
  4. Dr. Argento

    Dr. Argento

    Joined:
    Jan 29, 2015
    Posts:
    23
    I am testing in Unity 5.4.0B14 and works properly.
     
    Ghosthowl and Dreamaster like this.
  5. Dreamaster

    Dreamaster

    Joined:
    Aug 4, 2014
    Posts:
    148

    FEATURE REQUEST!!
    Not sure this image is doing it justice, but if you set the Mie G close to 1... you get one of the most beautiful "suns" I've ever seen! But then of course you lose all of your God rays because you've just compacted them down "into the source". What I did here was, of course, make a 2nd directional light with another volumetric script. Obviously this isn't ideal in terms of performance though! So if it's at all possible, would there be a way to make the script stack a second volumetric effect on the same directional light? I could see this dual effect being useful on the other light types as well.
     
    PyroclasitcMayhem likes this.
  6. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    Sounds easy enough. I'll think about it when I have time.
     
  7. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,649
    Here are some images I made with this and Gaia and for the latter images, Tenkoku :)

    It did spam a lot of these messages into the console : Dimensions of color surface does not match dimensions of depth surface.

    Grab 20160414174541 w1920h1029 x23y59z-77r19.jpg Grab 20160414174411 w1920h1029 x20y59z-74r150.jpg Grab 20160414181940 w1920h1029 x0y63z0r114.jpg Grab 20160414183416 w1920h1029 x-13y62z-81r149.jpg

    Would happily pay to purchase this asset and see it further developed! Very nice!
     
  8. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,456
    This package keeps crashing my system after about 5 minutes of use... before it crashes though it shows some of the most gorgeous volumetric lighting I've ever seen. :)
     
    macdude2 and AdamGoodrich like this.
  9. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,649
    Yeah its stunning! I haven't had any crash issues - but it certainly has issues there somewhere because of the error log spamming. Also find that if you play with post fx too much it becomes unstable. Resizing the screen seems to fix this.

    Btw, as you probably know, in the last two images the skies and lighting are Tenkoku! I put a Suimono beach in as well and thought i took some images as it looked spectacular - but must have distracted myself :)
     
  10. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,649
    Any idea how to get rid of this ?

    Dimensions of color surface does not match dimensions of depth surface

    If you set the Resolution in VolumetricLightRenderer to Half or Quarter the error message stops spamming the console.
     
  11. Phesant33

    Phesant33

    Joined:
    Nov 13, 2015
    Posts:
    34
    Thank you!!!
     
  12. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    Very nice guys. If anybody makes something interesting with this plugin, please let me know. That's the only reward I can get here :)

    I've seen that before but not anymore. It happens only in full resolution rendering and I believe only in editor. I think it is a bug in Unity. I know how to "fix" it but not without side effects. I'll think about it. Also, using full resolution isn't recommended for performance reasons.

    Thanks but that's not going to happen. As I said before, I already have a job. I want more free time not more money :) But that doesn't necessarily mean the development ends here. I'll detail my future plans soon. No guarantees, no promises obviously.

    Thanks for the second part :) I can't give full support but I will fix bugs if I can reproduce them on one of my PCs. If you (or anybody) gives me steps to reproduce or more information about any issue you have, I will look into it.
     
    AdamGoodrich and red2blue like this.
  13. benoneal

    benoneal

    Joined:
    Apr 15, 2016
    Posts:
    18
    I'm using Unity 5.4.0b12, 64bit, and it looks like the "Height" and "Noise" options don't do anything at all, no matter how extreme I make their settings, and volumetric lighting doesn't work at all for point lights. The spotlight seems to work in some conditions in your example, but not in my project. It's not throwing any errors (beyond the "Dimensions of color surface..." error already mentioned), but just doesn't do anything.

    On the other hand, the directional lighting is incredible and has added enormously to the atmosphere I'm trying to create for my game. For a tiny bit of perspective: my game is set on a world suffering from millenia of war and global catastrophes, and the atmosphere is filled with dust and ash and other greenhouse gases. So for me, this sort of lighting is crazy important, and man, what you've created here is perfect beyond words.

    If the point lights worked, well, man, that would just be so much gravy.
     
  14. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    Thank you! You guys are seriously making my day with all this positive feedback!

    The 5.4 beta has its issues to put it mildly. It is working in b14 according to this post though.
     
    AdamGoodrich and red2blue like this.
  15. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,456
    Point lights work for me. And I don't get any errors at all, actually. I can confirm that the height setting doesn't seem to do anything. My only issue is crashing, but this isn't strictly an issue with these volumetrics, anytime my gpu get's taxed too high it starts to freak out my computer... so this just confirms that this is taxing on the gpu. That's all.

    Looks very nice Michal, congrats!
     
  16. benoneal

    benoneal

    Joined:
    Apr 15, 2016
    Posts:
    18
    Ok so I upgraded to 5.4.0b14, and I think I've got more information: spotlights work fine:

    upload_2016-4-16_0-7-48.png

    But point lights dont:
    upload_2016-4-16_0-8-56.png

    Unless you set them to No Shadows:

    upload_2016-4-16_0-11-7.png
    In which case there are obviously no shadowing interactions with the environment. :/

    However noise and height now DO work in b14, so that's awesome.
     
    Last edited: Apr 16, 2016
  17. Dr. Argento

    Dr. Argento

    Joined:
    Jan 29, 2015
    Posts:
    23
    Yes, the only problem i have atm is the point lights, doesn't work.
     
  18. Beinscheibe

    Beinscheibe

    Joined:
    Sep 24, 2013
    Posts:
    78
    Cool new additions in the newer versions. Still love the effect ;D

    Any new information on the SpotLight issue on the AMD side?

    EDIT:
    I digged deeper into the shader and found out, that the bug is gone if I change this line
    Code (CSharp):
    1. float4 light = atten * _LightColor * scattering * exp(-extinction);
    to
    Code (CSharp):
    1. float4 light = _LightColor * scattering * exp(-extinction);
    So simply removing the attenuation. Looks like it's a problem inside the method "GetLightAttenuation()", because if I set the return value to 1f, it still works...

    Also using the following line:
    Code (CSharp):
    1. float4 light = atten;// *_LightColor * scattering * exp(-extinction);
    still gives this bug, so I think it has to do something with this.
     
    Last edited: Apr 15, 2016
    Peter77, AdamGoodrich and hopeful like this.
  19. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    Hi, this might sound like a silly question, but would this work in Unity 4.6?
     
  20. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    Well, at least it is getting better. Few more betas and it will work as intended ;)

    I don't know. Unity 5 is the first Unity I've seen. But I think command buffers are kind of new, Unity 5 only feature?
     
  21. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    Nope, tried bunch of different PCs and nothing. But it looks like you've narrowed it down. You know I asked you to do that in this post. You said it didn't change anything. I guess we didn't understand each other. Or perhaps it has changed after the update?
    Anyway, can you continue and take the GetLightAttenuation function apart? Step by step.

    1) Delete everything unrelated to spot light. To rule out preprocessor mistake. That should leave you with this
    Code (CSharp):
    1. float atten = 0;
    2. float3 tolight = _LightPos.xyz - wpos;
    3. half3 lightDir = normalize(tolight);
    4.  
    5. float4 uvCookie = mul(_MyLightMatrix0, float4(wpos, 1));
    6. // negative bias because http://aras-p.info/blog/2010/01/07/screenspace-vs-mip-mapping/
    7. atten = tex2Dbias(_LightTexture0, float4(uvCookie.xy / uvCookie.w, 0, -8)).w;
    8. atten *= uvCookie.w < 0;
    9. float att = dot(tolight, tolight) * _LightPos.w;
    10. atten *= tex2D(_LightTextureB0, att.rr).UNITY_ATTEN_CHANNEL;
    11.  
    12. atten *= UnityDeferredComputeShadow2(wpos, 0, float2(0, 0));
    13. return atten;
    2) disable cookie
    Code (CSharp):
    1. // replace this
    2. atten = tex2Dbias(_LightTexture0, float4(uvCookie.xy / uvCookie.w, 0, -8)).w;
    3. // with
    4. atten = 1;
    3) comment out back projection
    Code (CSharp):
    1. atten *= uvCookie.w < 0;
    4) comment out distance attenuation
    Code (CSharp):
    1. atten *= tex2D(_LightTextureB0, att.rr).UNITY_ATTEN_CHANNEL;
    5) comment out shadows
    Code (CSharp):
    1. atten *= UnityDeferredComputeShadow2(wpos, 0, float2(0, 0));
    See what happens after each step. Hopefully one of them is the cause.
     
  22. Beinscheibe

    Beinscheibe

    Joined:
    Sep 24, 2013
    Posts:
    78
    Maybe I just made a mistake back then ;D Who knows.
    Did this and the line giving me the problems is the last one:
    Code (CSharp):
    1. atten *= UnityDeferredComputeShadow2(wpos, 0, float2(0, 0));
    Commenting this out, removes the artifacts, but also the shadows, which was somehow expected.
     
  23. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    Cool. We're getting somewhere. Maybe we'll figure this out after all. Let's try to remove shadow fading. It isn't properly implemented anyway. It shouldn't do anything judging by the code but who knows. Look at UnityDeferredComputeShadow2 and delete following block of code (+ remove fade variable from the rest of the method)
    Code (CSharp):
    1. #if defined(SHADOWS_DEPTH) || defined(SHADOWS_SCREEN) || defined(SHADOWS_CUBE)
    2.             float fade = fadeDist * _LightShadowData.z + _LightShadowData.w;
    3.             fade = saturate(fade);
    4. #endif
     
  24. Beinscheibe

    Beinscheibe

    Joined:
    Sep 24, 2013
    Posts:
    78
    Yeah I have a feeling we are getting close to it ^^
    But unfortunately the one pointed out by you wasn't the problem ;D

    EDIT:
    If you want we could also talk in Skpe or somewhere, to maybe speed up the problem solving ^^
     
    Last edited: Apr 16, 2016
  25. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    That's what I feared. Only two options left really. Shadow strength + shadow mapping and world to shadow matrix.
    1) Shadow mapping
    Code (CSharp):
    1. // replace
    2. return saturate(UnitySampleShadowmap(shadowCoord) + fade);
    3. // with
    4. return UNITY_SAMPLE_SHADOW_PROJ(_ShadowMapTexture, shadowCoord);
    2) world to shadow matrix. You can try to use Unity's matrix but it won't work with multiple lights. You can try to duplicate one light. Or at least keep two light very close to each other.
    Code (CSharp):
    1. // replace
    2. float4 shadowCoord = mul(_MyWorld2Shadow, float4(vec, 1));
    3. // with
    4. float4 shadowCoord = mul(_World2Shadow, float4(vec, 1));
    Maybe few more questions if it is still broken.
    Does it work correctly with only one light in the scene?
    Does it work correctly with two identical lights (same parameters, same position, rotation, same everything)?
    Do you see volumetric shadows AND black spots? Or the volumetric shadows don't work when you see those black spots?

    I'm mostly away from pc, so this is as fast as I can do it. But maybe we should move it to private conversation?
     
  26. Beinscheibe

    Beinscheibe

    Joined:
    Sep 24, 2013
    Posts:
    78
    Tried both things, but nothing has changed by doing so...

    1. It works perfectly with 1 (spot)light in the scene.
    2. No, this also reproduces the problem.
    3. Volumetric shadows are working fine, even so I see these black spots directly on the surface, on which the light shines.

    I have no problem switching to private, but I think it might be interesting for other people to see the status of this too. So let's stay here for now.

    EDIT:
    Now I'm lost... We updated to Unity 5.3.4 from 5.3.3 and now the bug is gone. I mean completely. This is a bit strange. ^^
     
    Last edited: Apr 17, 2016
    Peter77 likes this.
  27. DxStd_IgnatPribylov

    DxStd_IgnatPribylov

    Joined:
    Sep 24, 2015
    Posts:
    30
    Sorry for the late reply.
    Your assets are working [full] on the unity 5.4.b14. But, ha-ha, I can't compel them to work in my scene. He's got to work with custom terrane and Sky?
     
  28. Recluse

    Recluse

    Joined:
    May 16, 2010
    Posts:
    427
    Thanks for this!

    I've been using Robert Cupisz Lightshafts (also on github ) but that's not working in Unity 5.

    This looks fantastic and I look forward to trying it in my project.

    Do you know if it's PS4 compatible?

     
  29. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    A dead end then. It looks like the shader is ok and all input parameters are ok.
    Let's try something different. You said that the black spots appear directly on the surface. Maybe the volumetric effect works as intended and the built-in Unity shading gets corrupted as some kind of side effect. Try to disable the final pass so that the effect will render normally but will never be applied to the scene. Remove _preFinalPass command buffer from VolumetricLightRenderer.OnEnable(). The volumetric effect will disappear. What about the spots?
    Or use Frame Debugger and find the draw call that introduces those black spots. That would be even better. Make sure the game view is active, it doesn't work otherwise. Post a picture with the problematic draw call selected.

    EDIT: Just noticed that you no longer have the issue. That is a great news. I was getting desperate here :)
    It is funny. We want to release our game and we're trying like 10 different Unity versions. Trying to find the one that works best with our game. Every one has different bugs :)
     
    Last edited: Apr 17, 2016
  30. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    I'm afraid I can't help you if it doesn't work with 3rd party terrain or sky. I can give limited support for the effect itself but I can't deal with compatibility issues between various other plugins. Maybe somebody else would be able to help you if post more details.
    It probably won't work out of the box. At least not everything. There's nothing about this effect that PS4 can't handle but it is currently available only for DirectX. Projection matrices will probably be wrong due to different clip space and screen space coordinate systems.
     
  31. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Will we maybe see this on dx9 or maybe vulkan when that comes around? Loving the results in our project but the dx11 requirement is a small annoyance.
     
  32. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    I won't do dx9 port personally. dx9 gpus have less than 5% market share. And all of them are likely too outdated to run this effect anyway. OpenGL/Vulkan would be nice but I don't plan it at the moment. Pull requests are welcome ;)
     
  33. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Righto, the main issue is that dx11 isn't on Linux or Mac. But we'll probably find a solution when porting to those systems.
     
  34. Arrqh

    Arrqh

    Joined:
    Mar 31, 2015
    Posts:
    7
    So I don't have a Mac or Linux install to test on, but I got it working on Windows with -force-glcore41 to bring it to the same OpenGL version on Mac. Pretty sure I sent a pull request! I'm new at GitHub!
     
    Michal_ likes this.
  35. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    Accepted. Good work. I thought that the spot light's world2shadow matrix will require some tweaks too but it just works. I tested it on Mac and it works beautifully. Windows/OpenGL gives me about 1 fps but let's blame it on Unity/drivers.

    Thanks!
     
  36. Arrqh

    Arrqh

    Joined:
    Mar 31, 2015
    Posts:
    7
    Glad to help! I've generally found that getting DX11 stuff into the new GL Core is pretty easy these days. Well... most of the time, at least. :)
     
  37. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    Hey guys. Time for another update. I decided to continue working on this plugin but I'll be taking it into slightly different direction. Here's the roadmap. Let me know what you think.

    Roadmap
    1. Improved image quality and performance (ETA - couple of days). It is no secret that the half/quarter resolution rendering was an afterthought. I didn't need it for my purposes. It is buggy and slow. I decided to finally do something about it. First batch of fixes will arrive soon. Half resolution is now about 15% faster on my test scene and image quality is improved. I didn't really look at quarter resolution apart from fixing the most obvious bugs. It is now about 30% faster and image quality is ok if you don't have super thin geometry.
    2. Temporal filter (no ETA) - I'll either add temporal filter for camera movement only or I'll wait for Unity 5.4 and motion vectors. I haven't decided yet. It should result in better image quality and better performance.
    3. Full atmospheric scattering (ETA - a month or two). I want to add full atmospheric scattering for directional light. Only fog is currently simulated. It should result in unified solution that can render realistic atmosphere (everything from sky color to haze and fog).
    4. Volumetric clouds (no ETA). You can't really have a good looking sky without clouds. I want to add those next. It is a long term goal, no estimate yet.
    As always, no guarantees. Just my plan.
     
    MS80, Tiny-Man, elbows and 5 others like this.
  38. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,420
    Oh that roadmap is sweet music to my ears!

    Regarding number 2, motion vectors made it into the latest 5.4 beta so I suppose if it were me I would try that way first and see how good it is.

    Regarding 3 and 4, just wow! Before you published that roadmap, integration with other parts of a sky/clouds/time of day system were where most of my thoughts were going. Despite your roadmap I think I'd still like to ask a couple of theoretical questions about integration with other systems:

    Where do you stand if someone wanted to take some of your code and add it to their existing system, which they probably already sell for money via asset store or other means?

    Or, failing that, where do you stand in regards others publishing forks of your code for free?
     
  39. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    You don't really need my permission. The code comes under FreeBSD licence. You can take it "as is" and sell it on the asset store. There's nothing I can do about it.
    But if you respect the work I do and you want my approval then this is how I see it. Use it in any project, free or paid, in any way you like. As long as my code isn't 90% of the thing you're selling. In other words, as long as you add something of real value, feel free to sell it. It would be nice if you notified me about it, so that I can take a look. Also consider stating somewhere that you're using my technology. That's it.
    No requirements for open source but if you tell me about your project then I will take a look and maybe even help.
     
    hopeful, elbows and frosted like this.
  40. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,420
    Thanks so much for that answer :) It's not hugely likely at this stage that I'll be the one to actually do that, but I am shopping for a fairly comprehensive sky system and wish to quiz some asset authors about the prospects of including your volumetric stuff and your answer will surely be useful to any of them that consider it.
     
  41. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    I will publish the update later today. Both performance and image quality is significantly improved in half/quarter resolution (at least in my demo). There are still many places that could be improved but I think you could call it shippable now. Especially if you tweak it a little for your project.

    I also did a quick little experiment with temporal reprojection and it looks amazing. I can render the volumetric effect up to 4x faster with the same or better image quality. It is not going to be this good in real world scenarios (unless your scene is very static) but it should still help a lot. I'll probably publish experimental implementation some time this week. Stay tuned
     
  42. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    The update is live. The parameters that control downsampling, blur and upsampling are still hard-coded. You may have to tweak them a little to get better image quality based on your specific scene. I've put most of them to one place to make it easier. Look at the beginning of BilateralBlur.shader if you want to experiment with it. The quarter resolution is still experimental. It needs a little blur after/during upscale and a different downsampling method than the default one. I'm currently curious what the temporal upscale will do with it so I leave it as is for the time being.
     
    No0B25, Superjayjay and Peter77 like this.
  43. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    67
    Hi,

    trying out your awesome looking effect here I noticed something that may be a bug. At least I can't imagine that this is intended behaviour. :) I have a rather small and rather lowpoly indoor scene, so I thought I could afford this lightray effect performance-wise for midrange PC's. I've dropped the needed files in and it looks very nice, but for some reason when I turn sideways to the lightrays they don't shape after some of the objects anymore. Also notice that when the camera is turned the beginning of the lightrays shifts towards the center of the screen. When I look directly at the "source" of the lightray (in this case the window, see the video), it aligns perfectly though.

    As that is a very vague description, here's a video: http://cdn.che.moe/jzhziz.webm

    Maybe you have an idea how to solve this. For me it seems the same is happening in your example project and not only with the update you just posted. I'm on Unity 5.3.4p1 with a GTX680.
     
  44. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    Looks like a problem with the shadow map. Are the shadows working correctly? What light type are you using? Or even better, can you send me repro scene or steps to reproduce for the example scene?
     
  45. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    67
    Hi,

    unfortunately I won't be able to give you the exact same scene because the whole thing is in production right now. I could nail the error down to the red curtains though. To save a few polys they don't have backfaces, but the renderer is set to cast shadows double-sided. When I give the curtains real backfaces, the error disappears when standing on the opposite side of the room, but not the one that I made the video of. The lightrays also still shift when standing on either of the sides.

    Shadows are working correctly as far as I know. At least I haven't noticed any errors there. There are two directional lights that I need the lightrays for, because I need to be able to change the time of day. I'm turning the lightrays on and off based on the current time for each of the lights, so there is only one instance of the lightrays active at the same time.

    Here's an example project where I can replicate the error: https://www.dropbox.com/s/j80ca4yk5fxymct/Lightrays Bug Example.zip?dl=1

    Just walk around a bit and look at the windows where the curtains are closed. There it is seen most.
     
    Last edited: May 3, 2016
  46. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    Thanks @No0B25. It turned out I'm an idiot. I don't know how to reconstruct position from depth. The sad part is that I made this very same mistake several times in the past. Some people just never learn their lesson... I'll patch it soon. I'm talking about the effect being "disconnected/shifted" from other geometry.
    Your problem with curtains has something to do with shadow cascades. You can disable them as a workaround. Or use spot light instead. I don't know if it is Unity or my code and I don't want to dig into it now to be honest. I have more interesting things to do.
     
  47. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    67
    Hi,

    I'm waiting eagerly for the update. :) By the way, is there a somewhat simple way to render the lightrays on top of transparent objects? I have some rather important objects that need to be transparent (using Unity's standard shader in "Transparent"-mode), but they are always rendered on top of the lightrays making it look quite awkward. I tried setting the renderqueue in the shader, but that doesn't seem to do the trick. Any idea?

    Also, if you ever feel like digging around the shadow cascade thing, that would be really amazing. For now I "fixed" the problem by setting the 0th cascade to 0% of the shadow draw distance, which is unfortunate, but it still looks OK. For some reason it only works with the 1st cascade and on.
     
  48. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    882
    Hi,

    I tried to open the demo scenes on Unity v5.3.2f1 (DX11 on DX10 GPU) and I get these errors:

    "RenderingCommandBuffer: invalid pass index 3 in DrawMesh"
    and this error every frame:
    "Dimensions of color surface does not match dimensions of depth surface
    UnityEditor.DockArea:OnGUI()"

    Is there anything I can do or should I update Unity to 5.3.4?

    Thanks for your time :)
     
  49. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    I made a hotfix. I'm not sure if it is 100% correct but it is by far easiest/fastest way how to fix it. I don't really have time for anything better anyway. Let me know if it breaks something.
    There is no easy way how to make it work with transparent geometry. That's one of the limitations of this technique. It is possible but not easy. I'm not going to implement it myself. I can point anybody in a right direction if they want to try it. Or just wait for Unity's volumetric fog. A slightly different technique that should work with transparent objects.
     
  50. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    360
    I've never seen the first error. Try Unity 5.3.4 if you can. But maybe it doesn't work with DX10 GPUs. I don't think I have one to test it. Maybe I can force Unity to dx10 mode? I'll take a look when I have time.
    The second error is harmless. Happens only in editor and full resolution mode. I never got around to do something about it.
     
unityunity