march 2019 update : Scene Optimizer [Commercial]

V3DigitimesV3Digitimes Posts: 2,800
edited March 2019 in Daz PA Commercial Products

The Scene Optimizer is a set including several tools, Scene Optimizer first, and then Store and Restore Maps Scripts.

Scene Optimizer is a three tabbed interface dedicated help you to to lower the memory requirement and/or speed up renders and/or get a more responsive viewport by acting on various levels : maps resolution, "useless" maps removal, translucency removal, visibility, mesh resolutions, instances management.

Store Maps can store in a text file all the paths of the maps used in your scene so that you can restore them later on, using the Restore Maps scripts, on any selected node or surface of your scene. Store and Restore maps scripts can also be used for LIE baking or maps set swapping.

They work for both Iray and 3Delight, even if optimization necessits more efforts and is less efficient on 3Delight. The most impressive result is when Scene Optimizer manages to "fit in your video board" an Iray Scene which was initially too big for it.

I open this thread for anybody with remarks or questions about any of the scripts included. I hope this tool will help you.

SCENE OPTIMIZER SCRIPTS REQUIRE DAZ STUDIO 4.9.3.29 OR ABOVE

January 2018 update is live !

As some of you may have noticed, there are more and more png with alpha transparency used for make up or the eyebrows of Genesis 8 females. The map reduction of these, due to the transparency, often leads to a "black face" phenomenon. The logical solution should be to unchek the checkbox in the interface "Also reduce LIE maps / Also replace on surfaces png files with alpha transparency by their lower resolution version (see comments bottom of this tab)" and rerun the script, but it presently does not work, because until today, if the "black map" has already been created, it is loaded anyway, unless you physically remove the "black reduced image" from the content folder.

The bug which this january update solves is this bug : if you already had reduced these maps with transparency, then they were reloaded even if you unchecked the checkbox mentioned above. After this update (to be submitted before the 11th of january), this box will be unchecked by default, and the automatic load of the reduced maps with transparency will be disabled. This will prevent the "black face" phenomenon and if, by error, you check this box and the face becomes black after running the script, then you simply have to undo the script in Daz Studio, and re-run it without checking the box. The counterpart will be that the maximum width and height displayed by the interface for your figure will remain unchanged since the size of the maps with transparency will not change.

The update is ready, I still want to test a few cases of figures and then prepare the update package before submission. Believe me I'm sorry about this issue.

Post edited by V3Digitimes on
«13456789

Comments

  • grinch2901grinch2901 Posts: 1,232

    I am very interested in this, looks incredibly useful.  I just got done going through every surface of a building interior and removing bumps and normals, resizing from 4096x4096 to 1024x1024, etc and it was a big pain but I needed to do it to make the scene fit.  This tool looks like it could have saved me a lot of time and headaches.

    One of the features you mention in your promos is a "bake LIE" capability. So when this is used, it will bake the LIE into a single texture file, is that file saved somewhere other than the temp folder so it can be reused in the future?  

  • V3DigitimesV3Digitimes Posts: 2,800
    edited April 2017

    I am very interested in this, looks incredibly useful.  I just got done going through every surface of a building interior and removing bumps and normals, resizing from 4096x4096 to 1024x1024, etc and it was a big pain but I needed to do it to make the scene fit.  This tool looks like it could have saved me a lot of time and headaches.

    One of the features you mention in your promos is a "bake LIE" capability. So when this is used, it will bake the LIE into a single texture file, is that file saved somewhere other than the temp folder so it can be reused in the future?  

    Hi Grinch!

    For the first point, yes, you can do what you did with your building interior in a few clicks : one click for maps resizing, one click for normals removing and one click for bump removal.

    What is cool with the store and restore maps scripts is all what these scripts can do. For instance in your room if you realized at some point that you should not have removed the maps or resized the maps of some given nodes or some given surfaces, then you just have to select them, and hop, restore the maps (provided that you stored them before using the "Store" script). 

    What is cool too is that you can Store a "full rez" text file, then resize and create a "1/2 rez" text file, etc, etc, and then you can restore selectively on some elements the full rez, on other elements the 1/2 rez, on other elements the 1/4 rez, etc, etc. The Store file makes an image of the current status of your scene image maps, and you can save as many 'state files' as you want.

    Yes, for the LIE baking, it is what you say. These scripts can "bake" LIE maps, this means that :

    when you use the "Store" script for your scene, you will make a copy of the png file that corresponds to LIE property (the file which is in the temp folder of DS and is normally erased when you close DS) of your scene in one permanent folder. For this you have to save your scene before making the "Store" script (to make sure DS creates the png in the temp folder first). As long as you don't use the "Restore" script on the surfaces with LIE, they remain LIE. If you select these surfaces or Nodes and use the "Restore" script, then the LIE property will use the copy of the "baked" file that the "Store script" made in the permanent folder instead of the LIE. So you can use it afterwards in any scene.

    The permanent folder for baked LIE maps is the one you define in Scene Optimizer as the default content folder for Daz Connect image maps, or, if it has never been defined, a subfolder (which will not be erased) of the temp folder. To be sure there will never be baked images overwritten by other baked images, all the copies (png files) are located in a subfolder including the date, hour, minute (and second maybe) of the day.

    I hope this is more clear, let me know if you have more questions :)

     

    Post edited by V3Digitimes on
  • Does this affect the original maps or does it make copies before resizing? I'm a little confused by the need to use the Store/Restore script instead of applying the original materials preset (at least for the non-LIE cases).

  • thd777thd777 Posts: 914

    Great tool. A neat addition would be a checkbox to remove all maps from the inner mouth materials. That can safe a lot of space when the character has a closed mouth. 

    TD

  • V3DigitimesV3Digitimes Posts: 2,800
    edited April 2017

    Does this affect the original maps or does it make copies before resizing? I'm a little confused by the need to use the Store/Restore script instead of applying the original materials preset (at least for the non-LIE cases).

    It does not affect the original maps. Yes, if you have only one element to restore, and that you have the original material preset for it, then it is equivalent to use the restore for it or reapply the original maps.

    The Store/Restore will be interesing for all the elements for which no material presets has been provided - which is the case for a lot of props-, or for which you customized the material yourself (the material is not any longer the original material preset). If you want to restore the original texture set for a given figure you can of course use the original material preset if it exists. I think it is yet faster to restore several nodes/surfaces via the script rather than browsing for each material preset in the smart content, or even longer, in the content library.

    It can be interesting in a lot of cases. Initially the store/restore was not planned but my private beta tester worked a lot on the optimizer during the development stages and found that it was really important to add them. I had the same feeling before she told me, but the fact that my tester specifically asked for it convinced me to add them.

    They are many cases they can be useful. Well as I already said, this avoid you browsing your -smart or not- content, if the material preset exists (A lot of props come without material presets). For instance if you removed all the normal maps of your scene but you want to revert, either you browse your 20 elements of your scene looking for their original materials, or you simply select all the elements concerned and "restore" the original maps. One other thing you can do is that, this is still an example, remove far away normal and bump maps and divide all high resolution maps by two or four. Then you store the state as a "lighter" scene.  You can to go fast on the development stages (lights/poses/camera) remove all or almost all the maps, and then when you are ready to render, restore the "lighter" scene you made before, in one single click.

    In brief (I am always too long), this is equivalent to apply the original material preset, but you will gain a lot of time as soon as you have more than one node to process, as soon as you want to restore a "lower resolution" version of the material (for which not material preset exist), and as soon as the nodes you work on do not on their own material presets in the content.

    edit : One more thing you can do is that, for instance, if you had a scene with M7 and V7 with texture maps 1/2 resolution, and you stored the scene. Then in any other scene with V7 and/or M7, you can Restore the texture map state to get the 1/2 resolution without opening the Scene Optimizer.

    Post edited by V3Digitimes on
  • V3DigitimesV3Digitimes Posts: 2,800
    thd777 said:

    Great tool. A neat addition would be a checkbox to remove all maps from the inner mouth materials. That can safe a lot of space when the character has a closed mouth. 

    TD

    I had not thought of it! I'd prefer adding a script rather than making the base interface more complex. I'll have a look but presently I must finish painting tan lines!!

  • MegandocMegandoc Posts: 1

    Hi! Considering buying this excellent-sounding tool. Can you tell me if it whorls on Macs, please? Thank you.

  • V3DigitimesV3Digitimes Posts: 2,800
    Megandoc said:

    Hi! Considering buying this excellent-sounding tool. Can you tell me if it whorls on Macs, please? Thank you.

    Hello Megandoc, thanks a lot for your interest!

    Yes it should work both on MAC and PC.

  • posecastposecast Posts: 386

    Can this remove unused texture maps in a scene? I end up with a ton of unused texture maps after facegen experimentation.

  • V3DigitimesV3Digitimes Posts: 2,800
    edited April 2017
    posecast said:

    Can this remove unused texture maps in a scene? I end up with a ton of unused texture maps after facegen experimentation.

    Do you mean the texture maps which are linked to no surface but remain in the "DS memory"? If it is your question, no it does not do that, the fastest way I know so far to do what you ask is to restard Daz Studio.

    If it's not your question, I'm sorry I did not understood.

    Post edited by V3Digitimes on
  • AtiAti Posts: 9,043



    What is the difference between the settings of these two images?

  • V3DigitimesV3Digitimes Posts: 2,800
    Ati said:



    What is the difference between the settings of these two images?

    In the second image (the fast one), I used the optimizer to hide all instances from viewport except the two elements in front near the camera to get a fast and comfortable vieport management. Then in the same tab, I clicked on the button with "Memory Optimization" written on it. I restarted Daz before rendering, I'm not sure this is obligatory, but I'm used to work this way, I always found it more safe. And that's all.

  • AtiAti Posts: 9,043
    Ati said:



    What is the difference between the settings of these two images?

    In the second image (the fast one), I used the optimizer to hide all instances from viewport except the two elements in front near the camera to get a fast and comfortable vieport management. Then in the same tab, I clicked on the button with "Memory Optimization" written on it. I restarted Daz before rendering, I'm not sure this is obligatory, but I'm used to work this way, I always found it more safe. And that's all.

    Thanks!

  • BlueIreneBlueIrene Posts: 1,318

    Do these optimizations take long to run?

  • V3DigitimesV3Digitimes Posts: 2,800
    edited April 2017

    Do these optimizations take long to run?

     

    Not really. I depends on the number of elements you want to treat in the same time.

    The first time you will open the optimizer for a given scene there will be a scene analysis (objects, mesh resolutions, image maps) which will take a few seconds, up to a few tens seconds if you have a huge amount of elements in the scene. Then next times, opening the optimizer is much faster as long as you don't close DS. Then for optimizations steps themselves, most operations take a few seconds, but it essentially depends on the number of elements (and maps per elements) to process.

    The best way is to take an example : I took Genesis 3 base male wearing Jeans. Maps resizing (1/4) took 7 seconds for a total of 31 image maps (23 for Genesis 3 (because I'm on a tan lines shader) and 8 for the Jeans). Maps removal took around 1 second per map type (bump/normal). Changing mesh resolution is almost instantaneous. You have a progress bar to know where you are in the progress. But I tested huge scenes with plenty of maps for which it took me 5 minutes to process maps resizing and around 1 minutes for maps removal.

    One thing to note is that it is optimization is MUCH FASTER if you ARE NOT in iray preview mode when running the optimization script (otherwise Iray preview slows down the process).

     

     

    Post edited by V3Digitimes on
  • V3DigitimesV3Digitimes Posts: 2,800
    Ati said:
    Ati said:



    What is the difference between the settings of these two images?

    In the second image (the fast one), I used the optimizer to hide all instances from viewport except the two elements in front near the camera to get a fast and comfortable vieport management. Then in the same tab, I clicked on the button with "Memory Optimization" written on it. I restarted Daz before rendering, I'm not sure this is obligatory, but I'm used to work this way, I always found it more safe. And that's all.

    Thanks!

    :) You're welcome!
  • BlueIreneBlueIrene Posts: 1,318

    Do these optimizations take long to run?

     

    Not really. I depends on the number of elements you want to treat in the same time.

    The first time you will open the optimizer for a given scene there will be a scene analysis (objects, mesh resolutions, image maps) which will take a few seconds, up to a few tens seconds if you have a huge amount of elements in the scene. Then next times, opening the optimizer is much faster as long as you don't close DS. Then for optimizations steps themselves, most operations take a few seconds, but it essentially depends on the number of elements (and maps per elements) to process.

    The best way is to take an example : I took Genesis 3 base male wearing Jeans. Maps resizing (1/4) took 7 seconds for a total of 31 image maps (23 for Genesis 3 (because I'm on a tan lines shader) and 8 for the Jeans). Maps removal took around 1 second per map type (bump/normal). Changing mesh resolution is almost instantaneous. You have a progress bar to know where you are in the progress. But I tested huge scenes with plenty of maps for which it took me 5 minutes to process maps resizing and around 1 minutes for maps removal.

    One thing to note is that it is optimization is MUCH FASTER if you ARE NOT in iray preview mode when running the optimization script (otherwise Iray preview slows down the process).

     

     

    Thanks for the detailed answer :)

  • V3DigitimesV3Digitimes Posts: 2,800
    I'll be away from office at least 3 hours! I'll be then back for any questions :)
  • Griffin AvidGriffin Avid Posts: 3,667

    You choose which scene elements to optimize, guided by a list of your scene elements; sorted by distance from the camera, texture map size, number of maps, or number of faces in the mesh. You can process the action(s) of your choice on the elements checked in this list : reduce texture map size, remove normal maps, remove bump maps, remove all maps, remove translucency/SSS, or hide/show the scene elements entirely.

    When you have a chance...

    Is it possible to affect the distant objects enough to have their appearance simplified? I'd love to almost drop down to 'shaded textures' on distant objects.

    It's be great if I could lose detail in distant objects. Right now, everyone is using some kind of blurring/depth effect to simulate...depth. I would love to tinker with color- or lack of vivid color and texture detail EASILY as new option. Think Optimizer could be tweaked in this manner?

  • dragotxdragotx Posts: 1,114

    What kind of effect will this utility have on image quality for very high resolution renders?

  • dawnbladedawnblade Posts: 1,721

    This sounds great! Curious if the Store feature could be automatically triggered when you Optimize?

  • thd777thd777 Posts: 914
    dragotx said:

    What kind of effect will this utility have on image quality for very high resolution renders?

    If you use it correctly, it will have no effect on quality at all. 

    In this context correct means: You need to look at the size in pixels that each element has at your final render resolution. For example, if a face in the final render (no matter how large the complete render is) is about 500 px across and uses normally 4K textures, you can safely reduce those to 1/4 or even 1/8 without noticable loss of quality. If the same face is in the foreground and takes up 4000px, you need to keep it at full resolution textures or it will be blurry.

    Hope this helps.

    TD

  • Thank you for the explanation on Store/Restore.

  • V3DigitimesV3Digitimes Posts: 2,800
    avxp said:

    You choose which scene elements to optimize, guided by a list of your scene elements; sorted by distance from the camera, texture map size, number of maps, or number of faces in the mesh. You can process the action(s) of your choice on the elements checked in this list : reduce texture map size, remove normal maps, remove bump maps, remove all maps, remove translucency/SSS, or hide/show the scene elements entirely.

    When you have a chance...

    Is it possible to affect the distant objects enough to have their appearance simplified? I'd love to almost drop down to 'shaded textures' on distant objects.

    It's be great if I could lose detail in distant objects. Right now, everyone is using some kind of blurring/depth effect to simulate...depth. I would love to tinker with color- or lack of vivid color and texture detail EASILY as new option. Think Optimizer could be tweaked in this manner?

    Well you can reduce the texture maps down to 2x2 pixels maps (by clicking another time, and another time, and another time, until it is fine the button to reduce the maps resolution). The resolution of the biggest map used by an object is displayed and updated in the list of the objects of the scene provided in the interface so that you know "where you are" (the size of the image maps is also written in the texture maps name).

    But if I want to be totally honest, I don't know if at the end it will be efficient to simulate depth the way you describe it. It will not change the color in something less vivid, but it will "average" as maps become smaller... I have never tried to use it this way, of course you will lose detail, but I'm not sure it will have the expected "depth" effect. Sorry I cannot help you more about this.

    thd777 said:
    dragotx said:

    What kind of effect will this utility have on image quality for very high resolution renders?

    If you use it correctly, it will have no effect on quality at all. 

    In this context correct means: You need to look at the size in pixels that each element has at your final render resolution. For example, if a face in the final render (no matter how large the complete render is) is about 500 px across and uses normally 4K textures, you can safely reduce those to 1/4 or even 1/8 without noticable loss of quality. If the same face is in the foreground and takes up 4000px, you need to keep it at full resolution textures or it will be blurry.

    Hope this helps.

    TD

    Thanks for the question and thanks for the answer :) That is the answer that I would have given, except that thd777 is much more concise and more clear than the one I would have given !!!

    dawnblade said:

    This sounds great! Curious if the Store feature could be automatically triggered when you Optimize?

    Yes this could have been done, and I chose not to do so. When you store a scene status, a window pops up asking you where you want to save the text file and what name you want to use for it (so that you can have as many stored status as you want). The store file option could be proposed when you open the optimizer, but if you want only to play with mesh resolution or instances it would be useless. It could be opened when you click on a button to remove or resize maps, but you will probably sometimes resize with a given ratio the closest nodes, another ratio the furthest ones, remove the normal maps only of certain objects. And each time this window, asking you where you want to store the scene maps status, would pop up. And you would hate this window at the end!

    No honnestly I prefered people choosing when they considered the scene deserved to be stored. Now I tell to myself I could have included a button "Store Maps" in the interface, but I only think about this solution now that I write this answer.... Plus I always try to have the minimum I can in the interfaces, to keep them as clear as possible.

    But initially it was a choice to keep thinks separated..

  • V3DigitimesV3Digitimes Posts: 2,800

    Thank you for the explanation on Store/Restore.

    You're welcome Richard. Your question was really justified!

  • Cris PalominoCris Palomino Posts: 10,021

    I was wondering about something.  My workflow is that I do my work in Studio, as far as setting up a scene for a render, on my Mac and then transfer the scene to Studio on my PC since that one has my Nvidia card for rendering.  Both machines have the same content.  Will I be able to do this after I use your Scene Optimizer?

  • dragotxdragotx Posts: 1,114
    thd777 said:
    dragotx said:

    What kind of effect will this utility have on image quality for very high resolution renders?

    If you use it correctly, it will have no effect on quality at all. 

    In this context correct means: You need to look at the size in pixels that each element has at your final render resolution. For example, if a face in the final render (no matter how large the complete render is) is about 500 px across and uses normally 4K textures, you can safely reduce those to 1/4 or even 1/8 without noticable loss of quality. If the same face is in the foreground and takes up 4000px, you need to keep it at full resolution textures or it will be blurry.

    Hope this helps.

    TD

    Thanks for the answer, I'm going to have to think about this one.  Most of my renders everything is up close and personal, to the point that I have problems picking environments because even the backgrounds are too low rez.  I can definitely see this utility being a godsend for renders with a lot of depth and distance to them though.

  • V3DigitimesV3Digitimes Posts: 2,800
    edited April 2017

    I was wondering about something.  My workflow is that I do my work in Studio, as far as setting up a scene for a render, on my Mac and then transfer the scene to Studio on my PC since that one has my Nvidia card for rendering.  Both machines have the same content.  Will I be able to do this after I use your Scene Optimizer?

    It will be possible only if your content is completely "synchronised" (mean for instance on an external hard drive). Otherwise, the new lower resolutions maps which are created on your MAC will not exist on your PC, and then will be missing. If you did not created low resolution maps but only removed maps or changed mesh subdivisions or played with instances there will be no issue. But if you resized some maps, your content must be "synchronized" between your MAC and your PC.

     

    dragotx said:
    thd777 said:
    dragotx said:

    What kind of effect will this utility have on image quality for very high resolution renders?

    If you use it correctly, it will have no effect on quality at all. 

    In this context correct means: You need to look at the size in pixels that each element has at your final render resolution. For example, if a face in the final render (no matter how large the complete render is) is about 500 px across and uses normally 4K textures, you can safely reduce those to 1/4 or even 1/8 without noticable loss of quality. If the same face is in the foreground and takes up 4000px, you need to keep it at full resolution textures or it will be blurry.

    Hope this helps.

    TD

    Thanks for the answer, I'm going to have to think about this one.  Most of my renders everything is up close and personal, to the point that I have problems picking environments because even the backgrounds are too low rez.  I can definitely see this utility being a godsend for renders with a lot of depth and distance to them though.

    Let us know how it turns out, it will be a good information for people making very high resolution renders.

    Post edited by V3Digitimes on
  • mtl1mtl1 Posts: 1,463

    General question about the texture reduction: How does it differ from setting the maximum texture size in Iray Render Settings? Does Iray Render settings use some other algorithm and compression?

  • V3DigitimesV3Digitimes Posts: 2,800
    edited April 2017

    Setting the max Texture size is "one single compression number" (or two) for the whole scene, whatever the real interest of the maps for the render you want to make (some maps may be interesting to be kept high resolution, some are totally useless at the resolution they currently have). Texture maps reduction here allow you to specify which texture reduction you want for which objects. You can do nothing or just reduce slightly maps size for close very visible objects, and reduce strongly for far away ones, or "over textured" ones. Also I'm not sure that the normal maps are involved in the maximum texture size compression + thresholds. You can use it as a complement anyway.

    I have to go I'll be back tomorrow.

    Post edited by V3Digitimes on
Sign In or Register to comment.