Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

POLM - GPU Lightmapper - NLM denoising test !

Discussion in 'Assets and Asset Store' started by Vagabond_, Feb 5, 2016.

  1. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    POLM.png

    POLM v0.92.4b is an editor tool which is capable of baking per object Ambient Occlusion data into Textures or to Vertex Colors on the GPU using compute shaders. It requires a Graphics Card with support for DirectX 11 and OpenGL (4.3 and up or Core). The tool requires the Windows version of Unity3D Editor with a platform which supports compute shaders to be selected.

    * MAC support may come in Unity v2017.1
    * Baking AO to vertex colors can be processed on the CPU and does not depend on Graphics hardware and platform


    Asset Store link v0.92.4b - price 20$. | Documentation

    Demo - using NVidia GTX 750 Ti while screen capturing using the GPU (nVidia NVENC codec)



    Features:

    * Bake a single or group (one of a time) of objects and use some as occluders only
    * Bake AO to textures and to vertex colors
    * Fast object precompute using Rasterization technique
    * Preview the baking process (using the Standard Shader). Choose to either load or not the baked texture to the AO or Detail Map slots
    * Choose UV set to bake - UV, UV2, UV3 or UV4 - used when baking to texture
    * AO radius value
    * AO power value
    * CleanUp value
    * Darken up the AO values by adding more black - feature added by request.

    ----------------------------------------------------------------
    v0.92.4b
    ----------------------------------------------------------------

    1. The AO baking process is now 2 times faster
    2. Added a color field to give a background to the texture
    3. Switch to grid based uv set choosing options instead of using enum
    4. Move the dilate, blur and texture darkening to the GPU - much faster now
    5. Added a couple of buttons (to set all objects as blockers or as objects which will be baked) - This is useful in case you add many blockers and have to turn them all off one by one. Instead just make all objects blockers and enable the one you want to bake only.
    6. "Add % of black" field is now renamed to "Darken baked texture" and is moved to Post Process group
     
    Last edited: Jun 8, 2017
  2. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Hi gyus, POLM tool was approved and is now available in the store.
     
  3. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    714
    Hey Vagabond ... seem a very interesting tool!
    I was looking for something like this.
    Bookmarked!
     
  4. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,295
    Interesting, like it!
    Which UV-Channel is used?
    Would be great to choose between 0 and 1 or even 2, 3.
     
    Last edited: Feb 19, 2016
  5. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Thanks "sjm tech". If you think the tool needs some more features, any request is welcome.
    Cheers!
     
  6. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Currently the first one, but choosing a set of uvs comes in the next release as well. It is in the TODO list.
     
  7. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,161
    So, the resulting saved texture is used on the object with a custom shader?
     
  8. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,295
    Nice, let us know when it´s included so I´ll definately give it a try.

    (Another suggestion I would like to make is to optional output the AO-Map blended onto a 50% black background:



    This way the map can be applied to the Detail Albedo x2 channel, for example on large-scale ground planes or walls.
    The problem behind this approach is discussed here.)
     
  9. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    You can just use the standard shader which has a slot for AO maps or use a custom one.
    It is the same as to bake the AO map in some 3D package and import it to Unity.
     
  10. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    OK, it goes to the list. I will take a look at it.
     
  11. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,295
    You mean the Occlusion slot?
    I never use this slot because it´s sharing UV0 and this way its impossible to independendly use the AO-map for large scale objects (ground, walls,...).
    I know that by using the detailchannel for AO I am mistreating the Standard Shader, but in my eyes (and also in many others) the Standard Shader is definately missing a fundamental feature here....)

    EDIT: Oooops, you were a second faster, thanks for looking at it.
     
    Last edited: Feb 19, 2016
  12. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Yes, as you wish. It is saved as a texture so the devs can use it the way it suits their needs.
    I guess using it in the Occlusion slot is ok for some objects like statues of characters.
     
  13. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,295
    Right!
     
  14. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Just a quick test. AO map multiplied with 50% grey. I am not much familiar with the way you want to use that, but i see it helps. Is that the proper result. If so i guess a slider (0-1) to multiply with can be included.
     

    Attached Files:

  15. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,295
    Nice, I think this looks correct!
     
  16. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    OK, i will implement the UV sets as well as this feature as well as some other stuff and will update it in a couple of days.
     
  17. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    v0.8b just uploaded for review.
     
  18. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Hi guys, v0.8b is now available.
     
  19. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,161
    Windows and DirectX 11/12 are required but I assume it is possible to use the saved texture on the model in another device (Android SM 2.0), getting the same result, isn't it?
     
    Last edited: Mar 2, 2016
  20. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    The Editor has to run under DX11/12 mode right.
    And the texture is just a normal PNG texture as you would bake it in Blender or any other software which can bake AO textures and import it in the assets. So yes use it just as normal on any object.
     
  21. marggob

    marggob

    Joined:
    Feb 24, 2013
    Posts:
    65
    Question.
    In stage two objects. They are at a small distance from each other. Taken into account whether the second object when baked textures for a second? This can be useful for indoor scenes where you have to bake a common Ambient Occlusion for the stage.
     
  22. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Hi, if i understand properly, you want to be able to take into account some object which are very close to the object you want to bake ( e.g. a statue close to the wall ) . If that's correct, i am planning to add something like "Occluders List" in which you will be able to load objects in the scene which would actually occlude the object. That will however come in some of the next updates!
     
    Last edited: Mar 27, 2016
  23. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    I can believe i missed the thread!!!. :eek:
    On my buy list. :cool:
     
  24. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    :)

    I wonder if per vertex AO will be good additional option to the tool.
    OpenGL is now supported as well, but the update is not yet uploaded to the store.
     
    ZJP likes this.
  25. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    All additions are good if you keep the best option ever that your competitors (I have their products) do not have: the UV texture export.
     
    Vagabond_ likes this.
  26. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Deal !!! :cool: and friendly bump.... :p
     
  27. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Thanks, any suggestion for improvements is welcome as well... : )
     
  28. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Hi guys,
    still WIP, but Per Vertex Ambient Occlusion will be available in the next update - v0.9b

     
  29. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Oh yeah. :cool:
    About suggestions, a sort of 'Merging with Albedo' (or 'Merging with Main Texture') would be great, for those (like me :D ) are not comfortable with Photoshop's layers/calques.
     
    Brity likes this.
  30. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Yes, this is actually in the TODO list
     
    Brity likes this.
  31. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    687
    There are already quite a few per-vertex solutions in the store but If you want to add something that could boost the plugin a major amount then consider adding Indirect Occlusion between 2 or more objects

    This is an example of the end result, the ability to select a sphere and the plane it stands on and bake the lighting, the result is both objects are aware that their are areas of them being occluded and this produces the result:

    2 Objects, a Sphere and a Plane.



    Multiple Objects, all of which are aware that parts of them are being occluded due to their positioning:


    Allowing this sort of baking will increase its usefulness tenfold. Then you can allow for the optional baking of Shadows and Global Illumination colors. With all those the plugin would be complete and if you decide to add to use the second UV channel that can be generated with Unity along with a Texture Packer then it can pretty much replace the Enlighten.

    By then you should probably call it something else haha.
     
  32. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Hi, thanks for suggestions!

    I am actually on the way of doing it... Multi object baking is done ( still only Per-Vertex)...
    Will need to implement if for texture baking and to optimize and clean up the bake results...
    However i am doing some work on a game, but will try to find some time to work on that as well.

    After AO baking is implemented will try to implement some kind of LightMapping also ( Baking GI with color bleeding )...!

    NOTE: Support for OpenGL is added as well...

    You can take a look at the current state of Multi-Object baking.

     
    hakankaraduman likes this.
  33. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    687
    Oh wow nice work, looks like your way ahead of the game!
    I will be keeping my eye on this plugin.
     
    Vagabond_ likes this.
  34. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Hi.
    I know you're work hardees on DRCS, but any news about POLM? :D
     
  35. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Hi, yes the new update is ready... I think i will upload it in a couple of days !
     
  36. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Thanks. :cool:
     
  37. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Hi,
    POLM v0.92b is ready to be uploaded to the store... here is a quick preview video:

     
    SilverStorm and ZJP like this.
  38. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    687
    Well done. So for the one that is being baked to textures, are they gone into an Atlas or into the AO map for the standard shader? As you may know each extra slot of the standard shader adds 1 draw call so just wondering.

    The Vertex color one looked amazing, is there a way to make that effect stronger because it is very light and might not be obvious when a diffuse texture is added.
     
  39. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Hi,
    well the initial idea was to bake per object AO data into separate textures... Now as this is achieved the next step it to try adding some kind of GI to the textures ( by either using environment map, the scene lights or both )... As for packing the textures into atlas, this is in the TODO list with high priority and if i manage to deal with this, the feature might come in the next version... i need to do some research first on how this should be done... The point is that you will probably need a custom shader as i am not sure you can add custom textures to a lightmap asset which would be great if possible...

    There are controls for the AO power ( as you can see in the video the AO power is at 50%), as well as for the radius(distance) and cleanup value... so you have great control over it !
     
  40. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    687
    I am going to purchase your asset now and give some feedback.
    1.The scene lights is a good idea because that's how we already do baking.

    2.You can still use the standard shader, just put the baked data on one of the channels, maybe the Emissive/AO or Albedo channel of the standard shader?

    Usually lightmap objects render into 1 large texture and the objects in them get assigned a region of that lightmap which if the correct UV co-ordinates are applied will make it work.
    To simplify it I have attached an image demonstrating it. AO Atlas Example.png

    3.One other way which works for GI and AO is to simply render it over the original Diffuse to generate a new Diffuse but one that has the AO and GI blended into it. Photoshop uses a Multiply layer for the AO which merges it well with the diffuse layer. Once that is done a new image is created which only needs to replace the original Albedo texture and it should work just fine and be even better than an atlas.

    Let me know what you think.
     
    Last edited: Nov 26, 2016
  41. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    687
    Update: My first impression right out of the box is just WOW.
    However could you improve these:
    1. Make it so that whatever object I select automatically gets added to the "selected" section.
    2. Make the UI a bit more compact, for example allow me to select the "Main Panel" section and minimize it. Same with the "Precompute" and "Post-Process" settings. This way I can select a button you put next to those settings to hide/unhide those menu options for some needed screen space.
    3. I still have version 0.8 So I can't test multi-object baking. I can't wait to test it out!

    Other than that it's amazing! It even assigns the data to the AO slot of the Standard shader.
    I think this would be a good time to ask you to ignore the atlas feature for now and just make it so that there's a option to drag in a RGB diffuse texture and then after hitting bake it will merge the AO and Diffuse together using the AO Multiply Photoshop blending method to create a new RGB Diffuse image with the AO colors put into it. That way I don't even need an AO channel anymore it's just all there in the RGB!

    The new texture can now be used to replace the old RGB diffuse channel texture.
     
    Last edited: Nov 26, 2016
  42. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Hi, first of all you are currently using v0.8b and v0.92 will be out in a few day as it's pending review... i guess you are aware of that but just to mention... Other than that i agree with all the things you said:

    Adding objects automatically will be done...
    Put all the textures into atlas i think would require reapplying of the uv coordinated to all meshes... I need to do some testing etc.
    Currently blending the AO over the diffuse and save as a new texture is the first thing i could implement...
    Making the UI more compact is needed as well... !

    All you said is going into the TODO list...

    I'm glad you like POLM :)... and thanks for the feedback;
    It is always welcome as it helps me optimizing the tool !
     
  43. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    687
    I left a 5 star review, I was waiting to buy it for so long because it seemed too good to be true, all the struggle with Enlighten really damaged me :(.

    The ability to bake multiple objects and have them respect intersections has always been something very important in game development and I am glad your tool can do it!

    The AO Diffuse blend is gonna be a nice feature too.
    Would it be ok to ask to get the copy before the Asset store reviews it?

    I can PM you my email in a conversation?
     
  44. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Yeah sure... write a line to the contact email available in the asset store page :)
     
  45. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    687
    I am having some trouble with the default primitives in Unity. Rendering them seems to overwrite the built in Unity vertex colors and baked materials. Now when I create a new sphere or capsule or any other primitive they all spawn with the textures I generated for the cubes?

    Also the results aren't correct for them either, very strange: BakeBug.png

    Perhaps it should auto-generate a new material when baking too, just to avoid that, it's also quite handy for experimenting too, so maybe an option to generate a new material which it applies when baking is nice too.

    Haha it's quite funny, see how you somehow managed to access and overwrite the defaults which are usually greyed out?

    BakeBug2.png
     
  46. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Yes, the uvs of the Cube primitive are done so that all the faces are overlapped... it is normal to get weird result because of that..... Try export one from Blender (Max or Maya) with proper uvs...

    Looks like adding resources to the default-material from code does the job :)

    I actually didn't try bake an object using the default material - my first thought when baking is to create materials for the objects... This is the result after proper setup:

    POLM_Test.png
     
  47. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    687
    It looks nice, but then I realized if I had multiple objects such as panels for the wall and I needed 50 of them, even though they were the same object, does that mean they need to have a unique material for each one to properly work or does each wall having a UV2 enabled on import make it unique?
     
  48. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    As the tool is supposed to bake "Per Object" data... every object needs separate material of course...
    You always can bake one objects and just make as many copies as you want... that way all of them will use a single material...

    NOTE: POLM is NOT supposed to replace Unity's built in Light-mapping tools... Scene Lightmapping could be done but there is no access to the Lightmap data to store the baked data. In order to make a group of objects to use a single material all of them need to be packed into atlas as we talked... This can be done but will probably need an edited version of the shader you are using... This is one thing i am planning to implement... !
     
  49. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    687
    OK sure no rush. I was just wondering.
     
  50. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,032
    Last edited: Dec 8, 2016
    ZJP likes this.
unityunity