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.

Save shading information with files

Started by Dr PR, September 30, 2012, 12:17:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dr PR

I wish there was a way to tell the program to save shading information with a 3D file.

Some of my drawings take from 30 to 90 minutes to render the first time after opening the file. However, after having generated the shading information the first time the next shading after making a small edit takes only a few seconds. If the shading information was saved with the file these 30 to 90 minute delays would be avoided.

Saving the shading information would make the files larger, but I would be happy to trade slightly longer load times for very long shading delays.

Phil
DesignCAD user since 1987

JJG


magic

Hi Phil,

If it's at all possible, I'm all for it.
It's a kind of magic!




Dr PR

I should add one thing - we should also have the option of opening a file containing shading information without loading the shading information. Here's why.

I think (but I am not certain) that DesignCAD can only work with a 1 Gbyte address space, no matter how much RAM you have in your machine. Within this limited work space it must store the drawing, a backup copy (or undo information), shading information, shadow calculations, and other program variables.

I have been able to work with 275 Mbyte drawings, editing them, shading them, and generating shadows for images. I have loaded a 371 Mbyte drawing, edited it and saved it. I have loaded the same 371 Mbyte drawing and generated shaded images, but after that if I try to edit the drawing the program crashes.

So I think the maximum file size that can be worked on in all ways is between 275 and 371 Mbytes, or about 1/3 Gigabyte. Call this the maximum full workable file (MFWF) size. I think that just loading a file and shading it does not create a backup copy in RAM. Also, I think loading a file and editing it doesn't create shading information in RAM. So you can edit files larger than MFWF if they are never shaded, or you can shade files larger than MFWF if they are not edited after opening them. But you cannot do both on files greater than MFWF size.

In order to be able to edit files larger than the MFWF it is essential that shading information not be loaded into the program's work space. Therefore we need that option.

Phil
DesignCAD user since 1987

Dr PR

Here is one other thought about this.

The program often screws up rendering of some objects completely. This often happens when you mirror an object - the copy renders correctly but the original looks like a kaliedoscope. Basically, it gets the shading information mixed up for the two sides of a plane. The side toward the light source is brighter than the opposite side, but it looks like the program screws up the display point order and one end of a facet will be light and the other end dark. Sometimes a multisided planar polygon will render as a bunch of alternating light and dark triangles. This happens in almost every drawing I work with! It is worse in large drawings (where there is more to screw up) with long editing histories.

I certainly don't want this screwed up shading information saved with a drawing!

If we do have a save shading with drawing option, we also need an option in the program to purge screwed up shading information and start over. You can do this now by saving the drawing in Wireframe mode, close the file, reopen it and shade it again. It would be nice to be able to do this without closing and reopening the file.

Better still, fix the shading bug!

Phil
DesignCAD user since 1987

JJG

Phil,

concerning the problem with mirrored objects in your large drawings, to you try to apply sometimes the "Pack Solid ID" (an "Pack group ID") : in some of my drawings, it sometimes solves some other problems (such as  display or selection slowness , etc ...) so, why not this one ?

Dr PR

JJG,

Thanks. I do occasionally pack IDs for solids and groups. I typically create and then break up a lot of groups during an editing session. I use them as temporary collections to allow me to move many objects at once, but sometimes these aren't the final grouping. So I generate a lot of progressive ID numbers. I repack frequently to prevent ID overflow.

I just tried packing both solid and group IDs in a drawing with an object with strange rendering, and it didn't help. See the attached pictures. Exactly the same lighting and shading conditions were used for both images.

To restore the correct shading I closed the drawing and opened it again. Fortunately this is a small drawing (7.5 Mbytes) so it loads and renders in a few seconds.

In this case this is the copy object after mirroring the original along the Z axis. Either the original or the copy can have screwed up shading. Sometimes an entirely different object's shading is messed up after mirroring an object. On some occasions several objects are messed up. It isn't predictable, except that if you mirror often enough something will be messed up. Other operations may also be messing up the shading - I have seen it after solid Boolean operations.

Phil
DesignCAD user since 1987

Dr PR

#7
I did discover something new.* If you have a solid with screwed up shading and you subtract another solid from it, the new solid renders correctly.

First draw a simple solid somewhere away from the messed up solid.  Position it so it does not overlap or occupy the same space as the original solid. Then subtract the new solid from it.

The original solid will not be changed but it will render correctly.

Phil

* Thanks to prl for sharing this trick with us.
DesignCAD user since 1987

JJG

Thanks, Phil.

Indeed, like you, I have my side too sometimes some "screwed up" renderings, as you name them.

And thanks for the "trick" of a new "regenerate-command", to avoid to close the drawing and open it again !
My side, I changed the rendering mode (eg, from Gouraud to Quick), work during a little time in the drawing, and vice-versa, comme back to Gouraud, which can also solve some such problems.

Dr PR

JJG,

I have tried switching between all four rendering modes (wirframe, hidden line, Gouraud and Phong), disabling/enabling graphics acceleration and enabling/disabling off-screen bitmap, and none of these corrects the screwed up shading that I have described.

The subtract trick works only on a single solid with screwed up shading. After using it other solids may still have screwed up shading. In the image posted above the switch box is made up of many solids, and it looks like all of them got screwed up rendering after the mirror operation. I would have to subtract from each one, one at a time, to correct them all.

I guess I might be able to select all the parts and define them to be a single solid, and then use the subtract trick. But then it would be more difficult to modify just one part of the whole than it is by exploding the group, changing one solid, and then redefining the group.

Phil
DesignCAD user since 1987