Search Unity

TOZ Glow (Per Object)

Discussion in 'Assets and Asset Store' started by aubergine, Jul 1, 2015.

  1. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Selective glow effect per object.
    You define which objects to glow with an individual Glow texture.
    Works on mobile and desktop.
    Compatible with Single Pass Stereo Rendering.
    Compatible with GPU Instancing.

    There are 3 types of image effects for SM2.0 (Diagonal), SM3.0 (Both diagonal and Vertical/Horizontal)
    It works with any unity provided shader including the standard ones as well as any custom shaders which follow unity RenderType naming schemes.

    Glow is occluded properly with any of the above mentioned shaders.

    WEBGL DEMO

    Buy from:
    ASSETSTORE



     
    Last edited: May 19, 2020
  2. RavenTravelStudios

    RavenTravelStudios

    Joined:
    Oct 15, 2015
    Posts:
    100
    Hi Aubergine,

    is it working with sprite renderer for 2D also?
     
  3. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Yes it works with all Unity provided shaders including sprites and anything else. But i didnt submit it to Assetstore yet.
     
  4. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    There is a new update on the way which includes minor bug fixes and make the package compatible with VR Single pass stereo rendering.
    New update Works 2017.2 and onwards only.

    I do not intend to support previous versions, so make a backup copy.
     
  5. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Can you give me an idea of performance impact? We're using another glow shader now, and we often have 25-30 animated objects onscreen, all with selective glow, and it uses 3.5-4.5ms on the CPU (and a good CPU). Would love to buy this if yours is a lot more performant!
     
  6. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    My package doesnt care how many objects are on screen, it does create a correctly occluded fullscreen mask and applies the effect in one pass. It is also up to you to make things more beautiful or more performant.
    In my average demo running in the editor, the profiler says 0.25ms and im on a Intel core i7-6700 3.4ghz with an ancient amd radeon r7 200
    I can go up to 1ms and make the glow more beautiful, or i can go much lower. Its up to you.
     
  7. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    sounds great, thanks for the quick reply. We'll buy it and try it out!
     
  8. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Let me know if you need any customization. And dont forget to review :)
     
  9. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Got it, and yes, very very fast! :)

    Looks like there's no way to adjust the color intensity, right? I've adjusted the color on the texture, but it is still quite intense even with the texture becoming quite desaturated.
     
  10. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Try to make the glow texture use darker colors for less intensive parts and try to use brighter colors for the opposite.
    Or, if you dont care to add an alpha channel to your glow texture, add it and edit the TextureMask.shader line 36 as follows: return fixed4(result * mask.a, 1.0);
    This way your alpha channel will control the intensity of the glow colors. However, i strongly advise against it and its better to make a nicer glow texture with rgb channels only instead.
     
  11. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Oh, I forgot about the Glow Amount slider on the object, duh -- that does exactly what I need!

    Thanks again for this excellent effect!
     
    aubergine likes this.
  12. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    I do frequently update these packages, and customer reviews on the store encourage me to do better :)
     
    gecko likes this.
  13. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    So we have a tricky situation with one animal in our game -- the model has four meshes, and we need the third mesh to glow, but TOZ Glow uses the first mesh, no option to choose a different one. This is a very complicated rigged animal, so reordering the meshes in the model is not a good option. Is there any way we can assign the glow to (a) affect all meshes, or (b) just one selected mesh?

    thanks
    Dave
     
  14. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Couple of options here.

    1- When you say "four meshes", if you mean individual meshes, all you have to do is attach the GlowController.cs file to the transform whichever has the mesh renderer you want to glow.

    2- If you mean it has only one mesh renderer but has multi-material, you can edit the GlowController.cs file and change the material variable to be an array value in Awake function: material = GetComponent<Renderer>().materials[3]

    If you want all the multi-materials to glow, then you do the material as an array itself, and all other functions must be in a for loop.

    3- If the object(s) have a material in your project folder, you can edit the GlowController.cs file as to make the material a public variable and delete the Awake function and attach the script to any game object you want. But beware that this effect is actually per-material, so any other object using the same material will also glow.

    Just a side note, there is a bug in the code that when you use material instead of sharedMaterial, i forgot to destroy the material and it is leaking at the moment. I will release a bug fix version soon. But if you are in a hurry, just edit the GlowController.cs file and add the following:
    Code (CSharp):
    1.         void OnDestroy() {
    2.             Destroy(material);
    3.         }
    If any of the above sounds confusing, just send me the animal model and i will send you the custom package for it.
     
    gecko likes this.
  15. JediNizar

    JediNizar

    Joined:
    Nov 13, 2016
    Posts:
    111
    Hi did u tested it on mobile? would love to use it in my mobile project
     
  16. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    It works on mobile and it works very fast. Actually, it is meant to work on a mobile platform as default, for desktops there is room for more beautiful effect. Also works on VR gadgets.
     
  17. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    thanks! We did #3, works great!
     
  18. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    If you did number 3, then you can also use instancing, static or dynamic batching as well, it will be faster.
     
    gecko likes this.
  19. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Just submitted the new v3.0 update to the AssetStore. It will take some days until it will be alive on the Assetstore, but you can also buy it right now from TOZ Market.

    Check the new webgl demo to see it in action.
     
  20. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    New update is acepted and alive on the AssetStore now.
     
  21. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I just started having a weird problem with TOZ Glow. Was working great on Friday, but today, when it's activated, GPU usage skyrockets to 50ms to 300ms or more. But what's weirder is that my Unity coder doesn't see it happening on his end. We're all synced up on git, so it's baffling why I have this problem and he doesn't.

    I'm sure it's not a problem with TOZ.....but since I'm stumped, I wondered if you had any suggestions about what the actual culprit might be?

    Here's the profiler: if I drill down more, it just has N/A for Related Objects.

    thanks
    Dave

    toz profiler.PNG
     
  22. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    The previous version had materials leaking as default and there was garbage but not too many to crush your fps. And if you did the number 3 solution, it shouldnt.
    Anyways the new update is on the store. Please use that one. The only difference though is i use seperate materials and i destroy the material at the end, so there is no garbage.
    First, please remove the previous package completely both from your project and remove scripts from your camera and objects to glow.
    Second, please reset the material(s) that were previously effected by the glow, i mean only those that you added GlowController.cs. And you will have to re-apply the values and textures again sorry.
    Finally, use the new updated package as is without changing code as in its default state, it doesnt leak materials.

    I dont think it is the reason if you did number 3 though.
     
  23. LaCorbiere

    LaCorbiere

    Joined:
    Nov 11, 2018
    Posts:
    29
    Hi. Does your asset work OK with Unity 2019? I would like to consider it for mobile VR development. Any issues been reported? Thanks!!!
     
  24. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    We've been using this for awhile, and initially it was quite performant, but at some point it started using quite a bit of CPU - 3ms in a build. (See screenshot.) I don't know when this started happening, but any suggestions on what we can to get it fast again? We have the latest version from the Asset Store.


    profiler scent view enabled (2).PNG
     
  25. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    What is your unity version?
     
  26. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    We're using 2019.2.20, switched a few months ago. I am not sure if the worse performance coincided with that, or started while we were still on 2018.4.
     
  27. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Does your current flow involve loading/unloading scenes but keeping the effect active?

    There used to be a bug with unity on garbage collection of temporary render texture which was supposed to be fixed with 2018.4(some minor version)

    Anyways, as a generic fix instead of releasing the texture from memory, we can reuse the same texture while discarting its content(cheaper than cleaning memory) and only releasing it when the object is destroyed;
    1- Open Render_TextureMask.cs file inside "TOZ\_Shared\Scripts\Buffers"
    2- Remove the OnPostRender() function completely (all 5 lines)
    3- Add this to line 37: RenderTexture.ReleaseTemporary(maskTexture);

    This is a unity bug which isnt fixed since ages.

    Let me know if you need further assistance, i will answer faster if you contact by email.
     
  28. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Hmm, we are loading and unloading additive scenes (with terrain slices, using SECTR), but the main game scene is constant. Would this fix help? Doesn't seem applicable.
     
  29. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    The profiler screenshot above is actually from before we updated to the latest version. It's worse with the latest version, alas. Here's a screenshot -- so it's PP_Glow as well as Render_TextureMask that have big impacts, and those also somehow make other rendering (like Amplify Color) worse too.


    TozGlow profiler.png
     
  30. EstudioVR

    EstudioVR

    Joined:
    Jul 26, 2013
    Posts:
    127
    I just bought it to work in VR, but have problems. Any tips in VR?
     
  31. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    You said the memory usage is gradually increasing. If that is the case, it is related to memory leak bug of unity and there are fixes/hacks for it. But i need more info on your workflow.

    However, if you mean the memory usage is stable but high, it is about your current scene elements and the amount of pixels plus i see 2 graphic blits there including the amplfy thing. In that case, you will have to find ways to optimise, such as;
    * only glow objects when their screen size is above some value.
    * If the glowing object(s) share the material, edit the Glow_Controller to use sharedMaterial instead individual material(this will make all the objects glow that share the material and it is enough to put the script on one instance only)
    * edit the Render_TextureMask.cs file to decrease the rendertexture resolution to be half the screen or more.
    Finally;
    * decrease screen resolution
     
    Last edited: Mar 4, 2020
  32. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    What kind of problems? I need more details.

    Package Works with Single Pass Stereo rendering/Single Pass Instanced rendering, so currently my only tip can be to enable those without more info, however instanced rendering is in preview mode and you will have alot more problems with other stuff later on. Stick with stereo rendering.

    Finally, i released the package with 2018.4LTS, not tested with 2019 versions and i personally consider them buggy releases.
     
  33. EstudioVR

    EstudioVR

    Joined:
    Jul 26, 2013
    Posts:
    127
    The bloom is rendering out of the object. I am using 2019.2.21f. I have hundreds of assets, that works well on 2019.2. The problems is wrost on Single Pass.
     
  34. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I never mentioned memory, only the CPU and GPU costs. But what I don't understand is that these two camera components used 3ms on GPU until I updated to the latest from the asset store, and now the performance has dropped substantially. Is that expected?
     
  35. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    What do you mean by "out of the object"? Do you mean glow is misplaced or you just dont want it to glow out of the objects borders??
     
  36. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    The latest version doesnt have any significant difference from the previous except fixing the memory leak. Please send me the details of your scene about which image effects are active at the moment you see the cpu gpu costs spiking. Meanwhile ill install 2019.2 to check whats going on with it and will send you a custom package to fix.
     
  37. EstudioVR

    EstudioVR

    Joined:
    Jul 26, 2013
    Posts:
    127
    Misplaced. In your demo too.
     
  38. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Are you using any other image effect on your camera rig other than toz glow?
     
  39. EstudioVR

    EstudioVR

    Joined:
    Jul 26, 2013
    Posts:
    127
    No. As i said to you, it not work even in your demo scene.
     
  40. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    I have tested the package compiled with 2018.4.8f1 (64-bit) on a Samsung Galaxy S8 and Gear VR, and it Works both on multipass and single pass.
    I have no other means to try and test on other different gadgets or platforms. And i cant understand what problem you are facing from 1 sentence answers.
    You may ask for a refund from unity and i will grant it.
     
  41. EstudioVR

    EstudioVR

    Joined:
    Jul 26, 2013
    Posts:
    127
    The equipment you test is not the same as the one I use. GearVR is neither an Oculus Rift nor an Oculus Quest. Also, I don't see why you can't just install 2019.2.21 and try it out. It takes less than 10 minutes ... I already accepted that it doesn't work, ok. I looked for another solution. It was my mistake. I should have researched it before. And I don't want to be refunded. Thanks
     
  42. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Sorry i dont have oculus quest or rift and i consider 2019.x releases as buggy and beta products. But will install 2019.3 and see whats going on.
    I prefer to support LTS releases though.
     
  43. the_real_tdog

    the_real_tdog

    Joined:
    Feb 29, 2020
    Posts:
    4
    is there a tutorial on how to use this? I'm a unity newb, sorry.
     
  44. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Well, if you bought the package there is a readme file on how it Works and the demo scene demonstrates it.

    If you didnt buy it yet, it Works by rendering a texture which the objects are supposed to glow(determined by an individual object space glow texture) that is occluded correctly and through an image effect glows things.
     
  45. the_real_tdog

    the_real_tdog

    Joined:
    Feb 29, 2020
    Posts:
    4
    I did buy it, didn't see the readme file, I will look for it again
     
  46. the_real_tdog

    the_real_tdog

    Joined:
    Feb 29, 2020
    Posts:
    4
    I can load the demo scene, but it doesn't look like anything is glowing, but again I may be so new to Unity that i'm just not making things work correctly. I'm sure the readme file, when I find it, will answer more of my questions.

    Probably part of my problem is that I bought this from the Unity Assets Store, which did not give me the option to download the file, it gave me to option to open it in Unity... I don't know where it stored the installation package, which is why I've never seen a readme

    EDIT: Nope, no readme file that I can find anywhere
     
    Last edited: May 20, 2020
  47. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    1- Open unity.
    2- Click on Window->Asset store
    3- On the newly opened store window search for TOZ Glow or find it in your "My Assets"
    4- click on Download/Import to project
    5- After you finish import, you will see files in your Assets/TOZ/Glow folder.
    6- There is also a demo scene inside these folders, click on it.
    7- You should go and study Unity tutorials before buying things from the store.
     
  48. the_real_tdog

    the_real_tdog

    Joined:
    Feb 29, 2020
    Posts:
    4
    Thank you, I often wander willy-nilly into stores and buy things without watching any tutorials first.

    I am sorry if my questions seem dumb to you. Your demo scene doesn't tell me much on how to use your product. Your answers to my request for help, on the other hand, tell me a whole lot.

    EDIT: And yes, I found everything in the Assets/TozGlow folder, including your famous demo scene, but no readme file on how to use it.
     
    Last edited: May 20, 2020
  49. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    1.png
     
  50. Blaine99

    Blaine99

    Joined:
    Sep 18, 2019
    Posts:
    6
    Can you animate this glow in the timeline. I have a light up piano keyboard and I want to create an animation with the keys glowing or lighting up the notes that are being played. So can I turn on and off the glow somehow and animate it in the timeline? I need to sequence the lights so to speak.