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.

Odd shading mystery

Started by Dr PR, February 15, 2016, 12:03:53 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Dr PR

Here is a new puzzle!

I have attached two images and a file. They are for a 10-dog water tight door.

As you can see in the first picture the surfaces of the inner parts of the door display a darker shade of gray than the outer surrounding part. However, they are all the same "Default" material and are all the same color gray:

R: 191
G: 191
B: 191

If I select some of the darker inner rectangular "bumps,"  open the Info Box and use the "Same As" finger to click on the lighter outer frame of the door the selected parts do not change to the same color!

Also, if you rotate the view (second image) the inner parts of the door become lighter as the outer frame becomes darker. It really looks like the "normals" for the inner and outer parts are reversed so that the shading changes in opposite ways as the view angle changes.

How did this happen?

Is there a way to correct the problem without redrawing the whole thing?

Phil

Note: I see the same thing on my Win 7 Pro 64 machine running DesignCAD V25.2x64 and on my Win 10 Home laptop running DesignCAD V24.1.
DesignCAD user since 1987

Dr PR

#1
Here is another part of this mystery. The door came from a doors library file that contains many types of doors. In that file this particular door shades correctly (I just opened the doors library file and checked).

It was copy/pasted into a new working file. At the time I did not notice any odd coloration problems.

I'm pretty sure I rotated it around the Y axis by 90 degrees and then mirrored the door on the Z axis.

Then it was moved into position on an angled bulkhead by setting three handles around the outer frame and gravity snapping to points on the angled bulkhead. This aligned the plane of the door to the plane of the bulkhead.

After that I created a new user defined working plane in the plane of the bulkhead in order to move the door into position and place other objects around the door.

It was only after I reset the working plane to the normal working plane and Gouraud shaded the image that I noticed the odd coloration.

****

If I had to bet I would suspect the mirroring along the Z axis (see below). This has screwed up the normals of  many things I have mirrored so they had odd shading. But in the past this was corrected by closing the drawing and re opening it. This time the effect seems to be permanent.

I wonder if I saved the file while the user defined working plane was active?

Phil

Note: This weirdness doesn't show up in "File/Image/Save Image File" images (Smooth Shading) on my V24.1 laptop. Apparently it is something about the OpenGL Gouraud screen shading.
DesignCAD user since 1987

Dr PR

#2
It just gets weirder and weirder!

I went back to the original doors library file and copy/pasted the door into the working drawing on a new blank layer, rotated it 90 degrees around the Y axis and positioned beside the door from the first posts. The "doors 1.jpg" image shows the result. The new door is on the right, and it shades correctly.

Then I mirrored the new door on the Z axis. The "doors 2.jpg" image shows the results. The mirrored door is to the right of the one just pasted into the drawing (at center). The mirrored door shades correctly. So much for my suspicions about mirroring!

I moved the unmirrored copy to a hidden layer.

Then I selected the mirrored door, set three handles with the "Handles" function, and then moved (Move) it into position over the original door. This put it at the same angle as the original. Next I moved the new door to the right of the original and shaded the view (OpenGL Gouraud). The "doors 3.jpg" image shows the result.

Both doors shade incorrectly! But the shading errors are mirrored on the two doors. Where one part is too dark on the original door it is too light on the second door! Aaarrrrgggggghhhh!

For a sanity check I enabled the layer containing the pasted but unmirrored and unmoved door and it still shades correctly!

****

So it looks like it is the moving of the door using three handles that has screwed up the shading of the doors.

I have done this many times before and never saw this happen.

****

One other thing - notice that the dogs and the label over the door are not affected. The dogs are the "Steel" material and the label is "Aluminum." So maybe it is only the "Default" material that is being messed with.

Phil
DesignCAD user since 1987

Dr PR

#3
I solved the problem this time by pasting another copy of the door into the drawing and mirroring it. It still displayed correctly.

Then I measured the angle of the bulkhead relative to the X axis and rotated the door appropriately with the "Rotate" function. It still displayed correctly.

Then I deleted the corrupted copy of the door and moved the new rotated copy to the proper position, dragging it by one handle. It still displays correctly with OpenGL Gouraud shading.

This was easy because the bulkhead was vertical (no angle to the Y axis) and I needed to rotate around only the Y axis.

If I was trying to orient the door to a surface that was at angles to all three axes (simultaneous rotation around three axes) this would be very difficult without using three handles and the "Move" function!

Phil

Note: I tried to  post an image of the correctly shaded door in place on the bulkhead - but the program crashed!

This hasn't been a good day, with the problems with Win 10 and the oddly shading door. It's a good thing I enjoy debugging, otherwise I'd take up finger painting as a hobby.

Edit: I restarted the program, loaded the file and waited 10 minutes for the OpenGL Gouraud image to shade (116 Mbyte file). Then I generated two "File/Image/Save Image File" pictures, one with the "Current View" while the Gouraud image was displayed, and another "Smooth Shade" while the on screen image was wireframe. Here is the Smooth Shaded image. It took all day to put this one door in the drawing! Now it's about time for bed!

Oregon recently legalized marijuana sales and possession. If I have many more days like yesterday and today I may have to buy some really sticky buds and smoke them to calm my nerves!
DesignCAD user since 1987

Dr PR

#4
Here is a totally unrelated anecdote.

This door was on the front of the forward superstructure on the O1 level (the first deck above the main deck). This part of the ship took severe pounding in heavy seas. Seas coming over the bow crashed into this bulkhead.

On one occasion when I was on the bridge in a typhoon we had green water coming down from above on the O5 level roof of the navigation bridge. The O5 level was 52 feet above the load water line! At that moment the bottom of this door was submerged almost 30 feet. Typhoons made life interesting!

That's why the door had 10 dogs. The force of the water could warp the door. The rectangular raised "bumps" strengthened the flat door surface and it had "I" beam stiffeners inside, but 10 dogs were needed to keep the door tight against the internal seals. On other parts of the ship higher and farther back watertight doors had only eight or six dogs.

Phil
DesignCAD user since 1987

Dempsey

Hi Phil,

Your "anecdote" gives interesting background information.

And you "smooth shaded" image looks great. From time to time I spent an hour or so drooling over you epic effort of the Oklahoma drawings. It always gives me a new boost of energy to do just a simple drawing.
Dempsey

Lar

#6
Phil, when dcad does weird coloring I use the Set View command (Y) and orbit a bit, and the coloring corrects itself. Once it looks ok I press Esc to abort the orbiting.

I don't do any final color rendering in dcad so I can't say if the weird coloring gets printed that way. I far as I remember image-saves are ok.


Sorry ignore the above... I didn't realize you attached the file.

I downloaded and opened it and it behaved just as you described and orbiting did not 'correct' it. On further investigation <<...warning: I didn't have time to read through all your posts so you may have already written what I'm about to say...>> I noticed the lighter gray back thing is a Solid and the darker stuff are not solid defined. I extruded the bigger dark plane (to make it a solid) and it immediately colored exactly like the light gray back Solid. I then Solid Exploded the back Solid and the components turned dark like the original front stuff.

I can't remember seeing this sort of dual coloring for regular entities but I always see it with Symbols (and maybe Blocks). With Symbols things that are white (255, 255, 255) shade as if they are black (0, 0, 0), ie, not pure black and white but different shades of gray.  If I explode the Symbol the whites shade as white, so it seems the Symbol code got left out when dcad started distinguishing white shading from black shading. In fact, I just checked in your file and my white shades exactly like your light gray and my black shades exactly like your dark gray. Maybe that's a clue to assist DT&Co in solving your puzzle.

Lar

Dr PR

Lar,

That's interesting that the extruded plane started shading correctly.

This is the first time I have seen this weird behavior since OpenGL Gouraud shading was introduced way back when. Occasionally I do see surfaces that do not shade correctly - usually just black and normally just after a file is opened. Rotating the view or "Regenerate All" or "Fit to Window" will cause them to shade correctly (anything that causes the screen to redraw).

But this is definitely different!

In case anyone is interested in pursuing this mystery I have attached the original door that was pasted into my larger drawing. This is before rotating, mirroring and moving with three handles. It was copied from the door library file. It shades correctly on my machines. It would be interesting to see if any one else gets the strange shading problems as a result of mirroring to the Z axis or moving it with three handles.

Phil
DesignCAD user since 1987

Lar

#8
Phil,
I downloaded your original door. Mirroring and moving did not bring about the shading anomaly like your original sample.

Here's something you might find interesting, though:
  Using the move command with 3 handles I eventually turned the door upside down. What immediately jumped out at me was that the 'bumps' on the door appeared to be pushed in rather than pushed out. Being ever intrigued by the power of optical interpretations (as opposed to optical illusions) I tried to but could not convince my vision that they were bumps and not recesses. I then zoomed in to study the bumps to try determine what caused this 'visionary mis-interpretation'.

Eventually I realized that it was the classic case of lights and shade: the sides of the bumps facing me were colored dark gray and the sides away from me were colored almost white. Since the light source was set to 'move with eye', my brain correctly interpreted this as a recess, ie, dcad shaded these surfaces incorrectly. Funny thing is, the tops and bottoms were correctly shaded (closer shaded light, further away shaded dark)... but the sides overruled, maybe because they are longer.

Another thing: in trying to convince my vision that they were bumps and not recesses I took the shape of the edges into account (chamfered corners) and orbited the view left/right to see if the changing width of the edges would influece my vision - ie, if I orbit the door away from me the edges close to me would naturally appear wider and those away from me would appear narrower.  However, this did nothing to change my vision's opinion that they were recesses. It just seemed that the recess got more and more skewed, ie, the more I orbited the door away, the more the 'apparent back' of the 'recess' pushed itself 'away from me and under' the flat part of the door, thereby 'making more of the closer edge come into view' and 'more of the further edge move out of sight under the flat part of the door'.

I wonder how others would interpret this incorrect shading of the edges of the bump.

Lar

Dr PR

Lar,

Thanks.

It's interesting that fewer parts of the drawing are displaying wierd on your system. Are you sure it was the three handle move that caused the problem?

What you have experienced is exactly why I use OpenGL Gouraud shading often. I work in wireframe until my mind loses track of which side of things I am looking at. Then I switch to Gouraud and rotate the view to see what is going on. In large crowded drawing I have to do this frequently.

Rotating the view with OpenGL or wireframe is very slow and jerky in large drawings. Rotating RedSDK wireframe and Draft shading is many times faster.  I am looking forward to the day when we have RedSDK smooth shading.

I learned to shade the view frequently the hard way. Many years a go I made a pretty large architectural drawing with lots of things in it. Somewhere along the way I lost track of which way was up while rotating the drawing in wireframe. A couple of hours later I shaded the drawing and realized that I had drawn almost half of the drawing upside down and/or backwards, and the rest right side up! This was when shading a small drawing was very slow and took many minutes to complete.

Today my 100-200 Mbyte drawings take 10-20 minutes to shade the first time, but I don't mind the wait. It is much better than having to redraw several hours of work to get it right side up or have none of the front side turn up on the back! I always shade drawings as soon as they are opened. I go get a cup of coffee or read the paper while they are shading. After that switching from wireframe to OpenGL Gouraud takes less than a second unless I have added a lot to the drawing. Then it might take a few seconds to switch to shaded views.

Phil
DesignCAD user since 1987

Dr PR

I just mirrored the properly shaded door on the Z axis. Then I created a new working plane so I could reposition the door against the angled bulkhead. I reset the working plane and Gouraud OpenGL shaded. The mirrored door now has the messed up shading!

There is something really strange about that door!

Phil
DesignCAD user since 1987

Dr PR

#11
V45.2x64
Win 7 Pro 64

I experimented a bit with one of the planes that is shading strangely - the large front surface of the door - behind all of the rectangular bumps.


1. I selected it, opened the Info Box and clicked the "Reverse the Order of the Points" button to reverse point order. It still shaded incorrectly.

1. I used the "Same As" finger to assign the properties of a part that is shading correctly. It still shaded wrong.

2. I used the Info Box to change the material from "Default" to "Brass." The material and color changed, but it was still shaded "backwards." That is, the front side that is exposed directly to the light source shaded like the back side should shade (darker).

3. I used the "Same As" finger to assign the gray "Default" material of one of the parts that shades correctly. It still shaded backwards.

4. I mirrored it on the Z axis - the mirror copy shaded wrong.

5. I rotated the surface 180 degrees around the Y axis and the side then facing the light source shaded correctly.

6. I set three handles on a copy of the surface that shaded incorrectly and moved it with the three handles. The surface then shaded correctly. I moved it again using the three handles and it then shaded incorrectly.

****

It's pretty clear that the surface normal is being reversed. Moving with three handles reverses the normal. What's odd is that this doesn't happen to all surfaces in the group (the door is a simple unnested group).

When I set the three handles I placed them in a "L" pattern, using a lower left point for the primary handle, a lower right point (same Y elevation) as the second point, and the third point was directly above the primary handle. Before I moved the plane I drew two lines in a "L" pattern. Then I moved the plane using this new orientation, with the first point at lower left, the second at lower right, and the third at the upper left.

****

I made a copy ("Duplicate" or "N") of the original door that shaded correctly and then used the "Rotate" (R) function to rotate it around the Y axis the number of degrees to place it parallel to the surface of the bulkhead. It still shaded correctly. So "Duplicate" and "Rotate" do not screw up the surface normals.

Phil
DesignCAD user since 1987

Dr PR

This morning I started the program (machine turned off over night), opened the file and OpenGL Gouraud shaded it. The last door that I mentioned above (moved into place without using three handles) shaded correctly.

I assigned a new working plane (View/Working Plane/Set Working Plane) and that door shaded strange - as described above.

Then I reset the working plane (View/Working Plane/Reset Working Plane) and it shaded correctly!

I switched back to the recently rceated user working plane (View/Working Plane/Working Plane Properties) and it shaded oddly again.

I changed to three other previously defined user working planes and the door still shaded oddly.

Then I switched back to the normal working plane (Reset Working Plane) and the door shaded correctly.

*****

All of this is interesting, but annoying. I will redraw the oddly shading parts of the door and see if that makes the problem go away. For sake of testing I have attached the original door and the first oddly shading door in earlier posts.

Phil
DesignCAD user since 1987

DrollTroll

Try combining all the stand-alone planes of the door as a solid. Seems to work ok then.
25 years with DesignCAD

Dr PR

DT,

Thanks.

I redrew the door. Might have been some vestigial gremlin lurking in the old parts that would come back to haunt me again.

But what caused this in the first place?

Phil
DesignCAD user since 1987