Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

TENKOKU - Dynamic Sky

Discussion in 'Assets and Asset Store' started by chingwa, Apr 12, 2015.

  1. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,772
    I invested about 12 months into building out an end to end javascript system from mobile client in sencha thru to web services and web app on node.js. it worked and was fast - but the biggest issue i had was with getting people up to speed... then we had weird reliability issues in the phone gap based mobile client - in the end i dropped it and went back to c# end to end sitting on azure - its now fast and reliable and easy to find people to work on it - wasted a lot of time and money :(

    There is an tool that converts js to c# on the asset store - should be a simple thing :)
     
  2. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Fortunately, you'll find the tie very pleasing to use!
     
  3. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    get one with volumetric designs on it
     
  4. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
  5. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I did a nearly identical process a year ago, what a waste of time. JS is just so bloody unstable. I ended up going back to ASPX and C# after a few months of chasing bugs that would work fine for a couple days then just randomly break. Not to mention browser processing would randomly change in an update with no warning to us.
    Those tools get you about 60-70% there. A lot of them don't handle collections or variable instantiation very well so you end up doing a lot of fixing after the conversion. I did a Suimono C# conversion at 2.0.4 and it was a complete pain in the ass. I tried 3 different converters and none of them worked that great. Ended up using a combination of all 3 outputs plus just doing a lot of it manually to get it working. I got it working but then @chingwa went and changed the code on me. ;)
     
  6. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    Yeah I figured that was going to happen... I do still plan on working on a full C# conversion of Suimono once it's up and stable after the upcoming 2.1 update. When that is done I'll also be looking into a Tenkoku conversion as well. I have the C# code you sent me sitting right here safe on my desktop and it will be a valuable resource once I start on my own conversion :)
     
    John-G likes this.
  7. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    My last iteration was probably 95-98% complete. There were still a few odd issues outstanding that I think needed to just be started from scratch in C# instead of converted. Also a lot of the code needs to be rearranged to be more efficient in a C# build but that can come after it is converted.
     
  8. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
  9. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,772
    Karearea likes this.
  10. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    Thanks for sharing your experiences Adam, both with Tenkoku and with Unity Terrain in general.

    I have a serious love/hate relationship with Unity terrain... I've been working off and on on a laaarge terrain the past few years and am constantly having to stop and reassess how I go about it. SpeedTrees certainly help though:) In my case I want to be able to render a massive amount of trees and the performance of speedtree is dragging me down a bit (though damn they look nice!). I'll have to look at your tree performance recommendations a bit closer and try them out on my end. Thanks!
     
  11. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    Hello All,

    I'm happy to announce that Tenkoku version 1.0.2 is now ready for download...

    Download Here: http://www.tanukidigital.com/download

    This version has been submitted to the asset store and should be available on the store early next week.

    --------------------------------------------
    RELEASE NOTES - Version 1.0.2
    --------------------------------------------
    WHAT'S NEW
    - Added global Wind Zone support. Settings are automatically modulated based on Tenkoku Wind settings.
    - Added built-in Reflection probe handling to automatically gather sky and scene information for Standard Shader.

    CHANGES
    - Rearranged camera handling to allow easier in-game camera switching.
    - Edited some internal weather variable names for consistency.
    - Enabled larger max limit on the cloud scale variable.
    - Cloud systems now wrap to the horizon better, removing glaring band of distant sky.

    BUG FIXES
    - Fog and Atmosphere rendering not combining properly with foliage/objects in some scenes.
    - Removed forced settings of Unity built-in fog. Tenkoku no longer overwrites these settings.
    - Tenkoku now sets tracked camera background color correctly.
    - Moon no longer lights sky, which was causing noticeable shift in lighting during dusk/dawn transitions.
     
    John-G likes this.
  12. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    Hi Chingwa

    I just purchased Tenkoku, and i think i am running into some issues.

    For the context : My game is already done. All my scenes / levels / ect ... that includes the use of multiple layers for the raycast and collision detection , for specific items, ect ...
    The last part of the game is : Setup the light and the environment.

    First issue : The reflection probe : You lock the probe that comes with the tenkoku prefab, to the " size of the world " . In my case, this is not ideal. so i switched the Gameobject.Find"Tenkoku Probe... " to another probe that was already setup in my scene. I have also commented out the auto-sizing. Will that break something in Tenkoku ?

    Second Issue : ShaftCaster for the main Camera <SunShaft> : Should i manually put the shaft caster in my main
    camera, and which one ? LIGHT_World ? LIGHT_NightSky ? LIGHT_Sun ?

    Third Issue : Shadows ? Which Light or script controls the shadows ?? The LIGHT_World shadow culling mask has everything BUT my enviro... it seems to be tied to my reflection prob culling mask, but inverted... i need shadows on my enviro layer / meshes .

    Thanks.
     
  13. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    Hi Feydwin

    Changing the probe size shouldn't matter in your case as long as it's already setup to best capture your scene. However you'll probably need to increase the custom probe's far clipping plane setting in order for it to read the overall sky information. The only time you may run into problems with using a custom probe is if the camera (and thus the sky) moves far enough away from the probe that it no longer sees the sky objects... in this case it's position would need to be updated.

    The sun shaft should automatically populate the correct caster for the sun once you hit play. However if you want to do this manually you should use the "Sun" object... not the light objects. If you run into problems with this just let me know.

    All scene lighting(and shadows) comes from the "LIGHT_World" object. It should render on any object layers you choose, EXCEPT it automatically disables the "sky" and "moon" layers as these are lit from elsewhere. Are you not able to customize this setting?
     
  14. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    chingwa :

    Thanks you for you very fast support :

    Got you for the probe.

    I set up the SunShaft manually, working fine now.

    Regarding the culling mask of LIGHT_World : I fixed it manually, For some reasons, many layers were disable, other than the sky / moon. Thanks for your input.

    Not sure it is the right topic but :
    I am in need of an ocean rendering plugin. I am currently checking all my options. I know you are working on an update to make it work properly with Unity 5 and Your sky plugin. Unfortunatly, i don t have a lot of time. would you have a date when that will be ready ?
    Thanks again !
     
  15. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
  16. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    That was a nice ready @Exeneva Thanks for sharing!
     
  17. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    Hello All,

    I'm happy to announce that Tenkoku version 1.0.3 is now ready for download...

    Download Here: http://www.tanukidigital.com/download

    This version has been submitted to the asset store and should be available on the store early next week.

    In addition to some minor bug fixes and settings updates, the main improvements in this version are in the sky color scattering effect and fog systems. Sky is now mostly generated in a skybox material, and has been improved for more realistic rendering, especially around dawn/dusk times. Fog and atmospheric scattering have been rewritten and are now generated via a camera effect. This allows not only better realism, but also takes care of a number of scene-combining issues with the old fog. Please take a look at the updated install instructions!

    For those who are using Tenkoku together with Suimono, you may notice some artifacts in the water with this new Tenkoku update... fixing these will require you to install the next version of Suimono (2.1) which I'm hard at work on and should have ready very soon.

    As always, let me know if you have problems/questions/feedback etc, either by email or on the forums!

    --------------------------------------------
    RELEASE NOTES - Version 1.0.3
    --------------------------------------------
    WHAT'S NEW
    - Reformulated sky scattering for more realistic sun and sky rendering.
    - Tenkoku now uses skybox for rendering sun and sky. Will automatically replace existing skybox settings on play.
    - Reformulated and improved Fog effects, now using camera image fx component. (see updated install instructions)
    - Added earth limb shadowing to sky light scattering.
    - Added "Override Unity Fog" option (Atmospheric Settings). Turning this off allows you to use the Unity built-in fog.

    CHANGES
    - Removed old fog calculations and the FogSphere game object. Fog is now calculated on the main camera.
    - Sun and moon sizes can now be set independently from each other by default.
    - Removed "Custom" rendering option for sun object.
    - Re-Enabled moon "sun shaft effects. must add second sun shaft camera effects to your camera.
    - Tenkoku now seeds and uses it's own custom random numbers to prevent overriding of system-wide randoms.

    BUG FIXES
    - Included Reflection Probe now renders skybox and proper distances by default.
    - Fixed issue where tracking camera was not registered correctly.
    - Fixed intermittent issue with disappearing stars.
    - Temporarily turned off LensFlare effect on sun.
     
  18. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Thanks.

    I was looking for upgrade instructions ... it might be an idea to have those as well as install instructions (which are normally for new installations).
     
  19. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    Yes that's a good idea. I'll add some instructions on upgrading to the documentation soon. In the meantime, at least for this version, I recommend an uninstall of the previous Tenkoku version and simply installing the new version as if it's new...

    1) delete the Tenkoku DynamicSky module from your scene.
    2) delete the entire Tenkoku folder from your project.
    3) install as laid forth in the normal install directions.

    This may not be necessary all the time, but it's usually the best course of action if you're unsure or you want to minimize any unforseen errors.
     
  20. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,772
    I just had an issue with the new release - I had only one sunshaft on my camera, but needed two - one for sun and one for moon. The doco says to only add one.

    Thanks for some snappy support work there Justin !! :)
     
    chingwa likes this.
  21. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    Yeah, I goofed! Tenkoku is now using 2 sunshafts on the camera. I hope to consolidate these into a custom shaft effect in the future, but for now Tenkoku is using the ones that ship with Unity. The documentation has been updated.
     
  22. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    AdamGoodrich and John-G like this.
  23. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,772
    Thought i would show off some of Tenkoku 1.03's magic with my new terrain system :)









    Keep up the great work Justin - totally loving it :)
     
  24. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    It's beeauuuuuuutiful! :)
     
    AdamGoodrich likes this.
  25. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,772
    John-G likes this.
  26. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    @chingwa I recommend giving The Witcher 3 some time when you are able. The atmosphere in that game is beyond stunning and you might be able to analyze it a bit.
     
  27. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    @Exeneva Unfortunately I don't have much time to actually play games these days... one of the great ironies of becoming a game/asset developer :D I've been paying attention to Witcher 3 though, and have been looking at videos and trying to get an idea of how they build their environments. I may eventually buy the game, but I can't justify the price when I know I'll hardly play much of it... I just want to analyze their terrain and sky effects :D I've also been doing the same with GTA5, now that it's on PC. My ultimate goal is to recreate the storm and rain effects from GTA5 in Tenkoku... they are some of the most atmospheric I've ever seen.
     
    AdamGoodrich and Exeneva like this.
  28. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    chingwa likes this.
  29. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,772
    Did i mention i really love Tenkoku :)

     
  30. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    If anyone is getting a pink sky error with Tenkoku while using dx9 (or Mac), please let me know. I have a small update that should fix this :)
     
  31. Kemp-Sparky

    Kemp-Sparky

    Joined:
    Jul 7, 2013
    Posts:
    72
    I seem to be having a problem with cloud generation on the Mac. It works beautifully on my PC, but it's always clear skies on the Mac. Could this be caused by a similar issue?
     
  32. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    @Kemp-Sparky Not sure if it's related. I can send you the update if you want to test it out though, just to be sure. Send me an email at konnichiwa[at]tanukidigital.com
     
  33. Kemp-Sparky

    Kemp-Sparky

    Joined:
    Jul 7, 2013
    Posts:
    72
    Done! I'll have to test it out later in the day, as my partner has the Mac with him. ;-)

    Thanks!
     
  34. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    A few times I have run into the clear skies issue but have not been able to nail down what is causing it. Removing and re-adding the object fixes it though.
     
  35. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Hi,

    It'll be useful to get info like whether its currently dark or light. To activate/deactivate day/night objects and ambience.

    I guess a sunrise and sunset time variable should be good to have.

    Also perhaps some indicator of the darkness level as it not dark nor light immediately - like a float fDarkness level (0-1) ... i'm sure you have some internal variable you can expose.
     
  36. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    Interesting. Currently you can access hour/minute/second variables, but there isn't a direct 0-1 range for the course of the day or light levels. Also sunrise and sunset times are not static, they vary according to the day over the course of the year, so there isn't a set variable for this either.

    You CANget the overall light levels of the level (not the sky, but the light attributed to the scene), by reading the ambient GI gradient of the "tex_MasterRamp" texture. You can also access this color in code by calling an internal function, and it may do exactly what you're looking for...

    Code (CSharp):
    1.  
    2. var ambientLightLevel : Color;
    3. var tenkokuModule : TenkokuModule;
    4.  
    5. function Start () {
    6.    tenkokuModule = GameObject.Find("Tenkoku DynamicSky").gameObject.GetComponent(TenkokuModule);
    7. }
    8.  
    9. function Update () {
    10.    ambientLightLevel= tenkokuModule.DecodeColorKey("ambientGI");
    11. }
    12.  
     
    mwituni likes this.
  37. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Thanks ... the light level should do it.

    But yes, because sunrise/set is dynamic, thus I said a sunrise / sunset time would be useful. Although that could be tricky because of day length in Tenkoko <> 24 hr in most cases.
     
  38. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    Hello All,

    I'm happy to announce that Tenkoku version 1.0.4 is now ready for download...

    Download Here: http://www.tanukidigital.com/download

    This release has mainly been about fixing a variety of bugs that have popped up here and there, or gone unnoticed. However I have also included a few new functions that some of you have been asking for. The first is better support for C# scripts. While Tenkoku is still written in javascript, I have included a new function that allows the much easier setting of Tenkoku variables from C# via Unity's SendMessage function. You can read about this more in depth on page 12 of the updated pdf documentation available here: http://www.tanukidigital.com/tenkoku/documentation

    I've also included a couple functions to help with syncing Tenkoku settings across a network. Calling Tenkoku_EncodeData() allows you to "stuff" time/date/weather variables into a single String that can then be synced to your client machines. Once you have the variable on the client you can call Tenkoku_DecodeData() to read and apply those settings on the client machine, thus mirroring the server settings. More info on page 11 of the documentation pdf.

    As always, let me know if you have problems/questions/feedback etc, either by email or on the forums!

    --------------------------------------------
    RELEASE NOTES - Version 1.0.4
    --------------------------------------------
    WHAT'S NEW
    - Added new function to help usage under C#. (see page 12 of the documentation pdf)
    - Added new functions to help Server syncing easier. (see page 11 of the documentation pdf)
    - Added "Sync Time to System" setting to automatically set time and date to realtime settings.

    CHANGES
    - "Auto Time" setting renamed to "Advance Time"

    BUG FIXES
    - Weather/fog scene blending has been improved.
    - Weather/fog is now affected properly by scene lighting.
    - Improved rain and snow shader lighting.
    - Repeating Random overwrite errors are now fixed (for real this time!)
    - Tenkoku now sets Unity's ambient mode to "color" automatically.
    - Sky now works correctly again under dx9 (fixes pink sky effect).
    - Fixed atmospheric fog clipping under scene geometry at extreme distances.
    - Fixed null reference error messages when two sunshaft components are not present.
    - Light ray Intensity settings now work correctly again. (under Atmospherics)
     
  39. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Nice, thanks.

    Will be nice to see back of null reference error messages when not using moon sunshafts.

    "- Added "Sync Time to System" setting to automatically set time and date to realtime settings."
    Can't see anything about this in the manual.
    But I would think its a good idea to separate date and time. ie. Most games are set at some future or past date, so useful if only the time component is set to system time when player logs in.
     
  40. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    Ahhh... yes I updated the manual with the new function info, but it needs a few more updates based on the latest version.

    I could add a 'Sync to Date', in addition to the sync to time so they can be turned on/off separately from each other. Good call.
     
  41. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    UNITY 5.1 report.... I just tested Tenkoku in the latest Unity version and all seems to be working well :)
     
  42. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    So maybe I'm missing something, but I'm having issues with what seems to be the LIGHT_SUN (and LIGHT_MOON).

    This is what I'm getting ... lit up meshes in a non-lit area...



    Thats in a cave scene. But same thing outside.

    So these are on a 'SmallDetail' layer (so I cull the layer from camera when a bit distant). If I change them to Default layer they display fine.

    I'm using Deferred lighting. I'm assuming this is to do with the thing about you're only allowed to disable max 4 layers from each light in Deferred - as I see that error every once in a while.

    You must be doing something with the Sun (and Moon) lights as I cannot enable more layers on the Culling Mask? ... only sky layer is enabled. I assume you meant that ... but then what about the 4 layers per light thing?

    If I disable LIGHT_SUN and LIGHT_MOON they render correctly.

    Thx
     
  43. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    LIGHT_SUN and LIGHT_MOON are supposed to illuminate only specific game layers and should be managed behind the scenes for you. What you likely need to double check instead is the LIGHT_World object. This is the light that actually illuminates scene objects.

    The other point may be that you need to tell Tenkoku what the "sky" layer and "moon" layers are in the CONFIGURATION tab... don't forget this setup step. If it's set to the wrong layers in your list it can for sure cause unexpected results.

    I haven't experienced any real issues with the "number of layers" error that Deferred Unity always throws... meaning despite the caution error it doesn't seem to have real problems culling lighting from appropriate layers in my experience. Just out of curiosity, how many layers do you have in your project... ?
     
  44. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    ALSO... This problem might, instead of a layer issue, be a shadow issue. Do these plant objects normally accept light shadows? as a test you might be able to put a normal cube object on the same layer and see if it has a similar issue with the lighting. If it doesn't, then these objects are almost certainly using a shader that doesn't accept light shadows.

    Obviously this can look weird, as in the above screenshot, where other nearby objects are accepting shadows and these are fully lit.
     
  45. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Hi,

    No - its not LIGHT_world ... I fiddled with that one first, but even disabling it makes no difference ... its def LIGHT_SUN and MOON lighting up these.

    I have 14 layers.

    Yes - sky and moon are set to (sky and moon) layers in config.

    It may be that in your tests your objects are on DEFAULT layer? That works - ie... as I mentioned earlier - if i change these prefabs to DEFAULT then they light correctly. I guess that also means it can't be a shadow issue - else they'd not work on DEFAULT layer.

    These are Speedtree - mobile ground cover package. But I also tested with other prefabs - got same result.

    Try test it by placing some grass etc and putting that on a new layer. Any object in fact ! :(

    Here's your test with a cube .. .1 cubes - on on default layer, the other on my SmallDetail layer (lit up!) ...




    EDIT:
    Just checked all my layers ... assigning the lit cube to layers Default, TransparentFX, and Ignore Raycast works, but all other layers : water, UI, sky, moon, ... make it light-up ... this isn't a 4th July feature is it?

    Plus i'm seeing the warning: Too many layers used to exclude objects from lighting. Up to 4 layers can be used to exclude lights, while your lights use 32: 'Default' 'TransparentFX' 'Ignore Raycast' 'Unnamed 3' 'Water' 'UI' 'Unnamed 6' 'Unnamed 7' 'sky' 'moon' 'Unnamed 10' 'Unnamed 11' 'Unnamed 12' 'Unnamed 13' 'Unnamed 14' 'Unnamed 15' 'Unnamed 16' 'Unnamed 17' 'Unnamed 18' 'Unnamed 19' 'CaveInterior' 'Unnamed 21' 'Unnamed 22' 'Unnamed 23' 'Unnamed 24' 'Ground' 'HS' 'Mechanics' 'SmallDetail' 'Unnamed 29' 'BlackoutBackgrounds' 'Occluders'
     
    Last edited: Jun 22, 2015
  46. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    @mwituni

    That also happened to me and i had to make a few changes to make everything work.
    If you have a light that excludes more than 4 layers, you can expect the lighting in the scene to break.

    To fix this, you will need to comment out these lines of code from TenkokuModule.js at line 653 :
    Code (csharp):
    1.  
    2. //SET LIGHTING LAYERS
    3.     /*
    4.     lightObjectSun.cullingMask = (1 << skyLayer);
    5.     lightObjectWorld.cullingMask = (lightObjectWorld.cullingMask &  ~((1 << skyLayer) | (1 << moonLayer)));
    6.     lightObjectNight.cullingMask = (lightObjectNight.cullingMask &  ~((1 << skyLayer) | (1 << moonLayer)));
    7.     lightObjectMoonWorld.cullingMask = lightObjectMoonWorld.cullingMask &  ~((1 << skyLayer) | (1 << moonLayer));
    8.     lightObjectMoonFace.cullingMask = (1 << moonLayer);
    9.     */
    10.  
    That code was automatically changing the layers of the lights and i could not change anything in the editor.

    After that, you will need to set every layer of every tenkoku light manually. ( worse part ). Make sure no light excludes more than 4 layers.

    One other thing that you need to change ( and @chingwa too ) is to set to 0 the bounce lighting from lights that do not affect the scene. If the bounce light is not 0, then it will still affect the scene, even if it doesn't affect those layers (sounds like a bug). Don't know if it will happen to everyone, but happens to me. Maybe it's for those who use Unity's real-time GI.

    I think that is everything i did to fix it :) let me know if you got it working.
     
    mwituni likes this.
  47. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    @eskovas hmmm.... you need to be careful here... the lighting code section that you're commenting out has the potential to break intended lighting behavior. It's mainly there to insure that the main light objects (LIGHT_World and LIGHT_NightSky) are NOT illuminating parts of the sky and moon layers, and to also insure that the other lighting objects actually are.

    That being said, I can see how the above would be causing those annoying deferred lighting error messages from Unity. I'll review this as well as the bounce light settings... it does sound like a Unity bug, but there's no reason that any Tenkoku lights should have bounce settings except for the LIGHT_World object.

    @mwituni Thanks for the detailed report... I'll set up an example scene and do some testing here on my end for this later today. Hopefully I'll be able to reproduce this issue and work out a solution :)
     
    mwituni likes this.
  48. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    @chingwa yes, the layers part need to be set carefully. but since it automatically sets layers in the script, there are some lights that only choose very few or only 1 layer, and that causes projects that have various layers to have those light layer problems.
    I set everything taking the code for the layers into account :)

    I think by default all lights have the real-time bouncing in their component, so all lights will have that part.
     
    mwituni likes this.
  49. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Thanks for your confirmation eskovas. I hadn't looked for the lines in Tenkoko's code yet ... I guess I trust him too much :D

    But yes, thats certainly what I suspected too - that is was the deferred lighting limit because some of Tenkoko's lights didn't allow me to add layers to the culling mask.

    Thank you for jumping on it.
    You're such an enthusiastic bug-stomper.
     
  50. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,763
    @mwituni OK this issue is fixed for the next update, which I'll be putting out soon!

    This was not a straight-forward problem to solve, since it really is a limitation of Unity that I didn't take into account when setting up the system. The moon object was the main problem, as it was being lit by lighting exclusively for it's own layer, which became impossible to control. In the end I had to redo this with my own built-in vectors rather than relying on Unity lighting vectors. A complete pain in the %$#@!. However this now lets me remove those ancillary lighting objects since they are completely unnecessary now, and since these lights will no longer be bleeding onto other scene objects I imagine you will see a performance increase as well. :)

    In fact the whole sky/moon layer management may now be completely unnecessary, which will most likely allow for a more streamlined install and setup process. :)
     
    John-G and Archania like this.