DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

file save with shading information

Started by Dr PR, February 18, 2011, 04:51:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dr PR

The DesignCAD file saves basic drawing information, but the information necessary to create a rendered image is not saved. With large files the time necessary to regenerate this shading information every time the file is opened can be substantial. For example, a 75 Mbyte file takes about 10 minutes for the initial Gouraud shading. A 240 Mbyte file takes almost an hour and a half to render the first time. Shading time is not proportionate to the number of objects in a file, but is influenced by the interactions between all elements of the file, resulting in an exponential rendering time as file size grows.

If the rendering information was saved with the file the time for subsequent shading operations when the file is opened again could be significantly reduced. The file size would be increased if the shading information is saved. This may have been a problem a decade ago when storage space was limited, but today when multi-terabyte hard drives are fairly inexpensive the only drawback to a large file size is the time to load the larger file. This is a much shorter time than it takes to regenerate the shading information.

I should note that after the initial Gouraud or Phong shading the time to render new views is much shorter. The 240 Mbyte file renders in less than two minutes the second time. Also, if new elements are added to the drawing, the time to render the modified drawing is increased only as necessary to generate shading information for the changes. So it is the initial generation of shading information that is so time consuming. If shading information was saved with the file this lengthy initial shading delay could be avoided.
DesignCAD user since 1987

JJG

Dr PR,

You are right when you says :"With large files the time necessary to regenerate this shading information every time the file is opened can be substantial ... for the initial Gouraud shading" (or Phong too)

From my side, I've often noticed that shading in Quick (flat) mode before shading in Gouraud or Phong could then reduce the time of the first shade in these two other modes that give more details, as if something was already calculated in Quick mode and was also taken for 2 other modes. And shading in Quick (flat) remains fast, whatever is said.


Dr PR

JJG,

You are definitely correct!

For initial shading Quick shading is fastest, Gouraud takes a bit longer, and Phong takes even longer. Add in shadows and Phong takes  longer still. After the initial shading all subsequent shading operations are much faster, so the first operation consists of generating a "color map" (or whatever the programmers call it) for all objects followed by the generation of the display. Subsequent shadings of all types do not have to generate the color map again. It is this "color map" that can take a very long time to generate, and it could be saved with the drawing to speed up future work.

Enabling shadows adds another step to the process to generate the shadow map, but even in huge complex drawings this extra step takes less than a minute.

I once experimented with this step-wise approach to shading to see how much time it saved. In fact, it really doesn't save any time. Doing a Quick shade before a Gouraud shade actually takes a bit longer than just an initial Gouraud shading. You are generating the "color map," creating a Quick shade display, then doing a Gouraud display. Just starting with the Gouraud shading eliminates the (very short) time required to start the Quick shade operation and create the Quick shade display. The same is true about starting with Gouraud shading followed by Phong shading.

I typically work between wireframe and Gouraud shading, and use Phong with shadows only after a design is finished. The first Gouraud shading may take quite a while, but a subsequent Gouraud or Phong shading is fairly quick, even for very large files. However, if I open a file in wireframe and immediately do a Phong shading with shadows it takes a relatively long time.
DesignCAD user since 1987