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.

Screwed up rendering

Started by Dr PR, October 31, 2012, 08:53:12 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Dr PR

I am starting a new post - this subject has been discussed elsewhere in an unrelated thread.

The program often screws up rendering of some objects completely. This often happens when you mirror an object - the copy renders like a kaliedoscope. Basically, the program 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!

See the first image. 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.

To restore the correct shading I closed the drawing and opened it again. See the second image. It was generated using exactly the same lighting conditions as the first image.

****

I recently discovered something new.* If you have a solid with screwed up shading and you subtract another solid from it, the remaining solid renders correctly.

The subtracted solid doesn't actually have to remove anything from the original. 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.

You can also use this trick to cause DesignCAD to clean up extra facets from a solid.

Phil

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

prl

Quote from: Dr PR on October 31, 2012, 08:53:12 PM
If you have a solid with screwed up shading and you subtract another solid from it, the remaining solid renders correctly.
The subtracted solid doesn't actually have to remove anything from the original. 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.

You can also use this trick to cause DesignCAD to clean up extra facets from a solid.

The subtracting a dummy solid trick somehow forces DesignCAD to rework the faces of a solid AND reorients the point order of those faces.  Much has been said that DesignCAD doesn't use surface normals but I'm fairly sure it does in a way. It has to for rendering.  Depending on the point order or a face, the normal may face into or out of the solid. Somehow the program is using the face point order as a surface normal substitute.  What you are seeing when mirroring is a screwup in the surface normal convention.


Dr PR

prl,

It isn't that easy afer all!

I created a complex solid. It rendered OK. Then I mirrored it on the Z axis - both the original and the copy had screwed up rendering.

I created a cube and duplicated it. Then I subtracted one cube from the original solid, and it immediately rendered correctly. Next I subtracted the other cube from the mirrored copy of the original solid. It rendered correctly, but the original had screwed up rendering!

There is something very messed up here!

Phil
DesignCAD user since 1987

prl

Quote from: Dr PR on November 01, 2012, 05:19:33 PM
It isn't that easy afer all!

DesignCAD is like that in so many ways . . . just when you think you've figured out a logic to sidestep a problem, it does yet another inconsistency.


Dr PR

To me this is a major nuisance. Not a drawing killing problem, but just an annoyance.

It is something you must be aware of if you are planning on saving images. The screwed up shading is saved in "Image Save" files, so you should close the file and reopen it before saving shaded images.

With large files this means a lot of wasted time. With small files it is still wasted effort.

Phil
DesignCAD user since 1987

minstrel

I was also baffled by these rendering glitches...so I set out to 'trap' it's source and indeed, as Dr PR mentions,
it is linked to mirrored copies.

Put up a 'video clip' to show it in action....hopefully it's the same issue discussed and hopefully and can be sorted out.

Special Link: http://www.crossresolution.nl/3Dspace/special links.htm

Minstrel

Dr PR

minstrel,

I tried to view your demo, but got a blank screen. I watched the blue progress bar showing the file loading, but after several minutes when it completed the time counter showed 0:00/0.00. Clicking the start/stop button did nothing.

I think this problem can also be caused by the solid Boolean operations, but it is most easily demonstrated with the mirror function. At one time I thought it was only the mirror along the Z axis that caused it, but that was just because this was the most common axis I mirrored along.

So far it doesn't seem to screw up the actual drawing, so I am guessing that it is messing up the the display list that is created when you first render a drawing. Something about the mirror command screws up the display list, and not necessarily just for the object being mirrored. My guess is a misplaced pointer that is causing garbage to be written into the wrong place in the display list.

Phil
DesignCAD user since 1987

minstrel

#7
I stripped the audio out to try to reduce file size....still no audio...but a different codec....

These video glitches are as challenging as those found in DesignCAD!  If your computer does not have
the same codec as mine, well, it simply will not play [..and there are lots of them!].

Special Link: http://www.crossresolution.nl/3Dspace/special links.htm

Hope it works for you now,

Minstrel

Dr PR

Minstrel,

It worked. That is a very good demonstration of the problem.

By the way, the "Duplicate" (N) function is not copy/paste. "Copy" and "Paste" are Windows functions that use a copy buffer. The "Duplicate" function does not - it puts nothing in the Windows copy/paste buffer.

There is more to it than that. If you copy and paste a group the Group ID is incremented twice. If you duplicate a group the Group ID is incremented once. I don't know if this happens to the Solid ID. If you copy and paste a lot of groups the Group ID increases rapidly. This can cause the Max Group ID to overflow. If this happens the program behaves strangely. If you save a file with the overflow you may never be able to open it again. I speak from experience.

In older versions the Max Group ID was about 16,000. It was very easy to cause an overflow. Current versions have a much larger Max Group ID (something like 2^31), and you aren't likely to get an overflow unless you create large arrays of arrays of groups. Still, it is possible. Newer versions have the "Pack Group IDs" and "Pack Solid IDs" functions to renumber IDs to the smallest possible numbers.

Phil
DesignCAD user since 1987