Getting colors to appear realistically

laukejas
Posts: 200
Joined: Sun Sep 05, 2021 8:27 am
Answers: 0
x 43
x 114

Getting colors to appear realistically

Unread post by laukejas »

Hi,

I know that appearances are not SWs main focus, nor something it is really good at, but I'm in a situation where I need to test various color combinations for a project I'm designing (most parts will be printed from PLA plastic, and I have RGB color sheet of the colors that are available), so I want to set up some appearances in SW and find the best looking combination.

Thing is, with default scene and lightning (3-point faded scene), the colors applied to a model seem way off, even when compared to the SW color palette preview. Also, they look different depending on the angle at which you look to the model.

I went into the lightning settings, disable everything except for the Ambient light. However, I am unsure where to set the Ambient setting at. At 1.00, the scene is way too bright, but the colors do seem to match more closely to the palette preview. At more realistic levels (0.70-0.80), the colors become much too dark.

I also went into the color settings, made sure I remove any textures (setting everything to use color.p2m file), and set reflectivity to 0, which seemed to help a bit.

But still, I am not sure what settings I should use overall to get these colors to appear as realistically as possible. Please note that I am not aiming to get an actual photo-realistic visualization - I only need to check the colors.

Can anyone advise on what are the best settings to achieve this?
User avatar
DanPihlaja
Posts: 849
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 813
x 981

Re: Getting colors to appear realistically

Unread post by DanPihlaja »

This uses Photoview 360, but maybe it will help?

-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
laukejas
Posts: 200
Joined: Sun Sep 05, 2021 8:27 am
Answers: 0
x 43
x 114

Re: Getting colors to appear realistically

Unread post by laukejas »

DanPihlaja wrote: Thu Apr 27, 2023 9:25 am This uses Photoview 360, but maybe it will help?
Thanks, I am aware of Photoview 360 (as we as Visualize), but they do complex renderings that have to be tuned just right to produce photorealistic or otherwise quality pics. I am not after that, I just want the basic colors to show up correctly in SW model view.
User avatar
JSculley
Posts: 648
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 881

Re: Getting colors to appear realistically

Unread post by JSculley »

Turn off the directional lights, set the Scene to 'Plain White' and set the Ambient light 'Ambient' value to 1. If you do that, what's on the screen will match the RGB values of the appearance:
image.png
User avatar
Frederick_Law
Posts: 1948
Joined: Mon Mar 08, 2021 1:09 pm
Answers: 8
Location: Toronto
x 1642
x 1471

Re: Getting colors to appear realistically

Unread post by Frederick_Law »

laukejas wrote: Thu Apr 27, 2023 10:27 am basic colors to show up correctly in SW model view.
How do you know the color was "incorrect"?
What are you seeing that looks, incorrect?

Color you see on the screen depends on the monitor, setting on the monitor: contrast, brightness, hue, color temperature.
If monitor is set to warm. Everything will be yellowish. Cold, blueish.
Next Windows setting that adjust all the above.
Next lights in the room you're in.

You'll need to calibrate the screen somehow.
laukejas
Posts: 200
Joined: Sun Sep 05, 2021 8:27 am
Answers: 0
x 43
x 114

Re: Getting colors to appear realistically

Unread post by laukejas »

Frederick_Law wrote: Thu Apr 27, 2023 1:55 pm How do you know the color was "incorrect"?
What are you seeing that looks, incorrect?

Color you see on the screen depends on the monitor, setting on the monitor: contrast, brightness, hue, color temperature.
If monitor is set to warm. Everything will be yellowish. Cold, blueish.
Next Windows setting that adjust all the above.
Next lights in the room you're in.

You'll need to calibrate the screen somehow.
Yes, you're right, but in my case I don't need to go that far (calibrating monitor), I was just seeking to get the colors on the part to appear the exact same as they appear in SW color palette in the appearances editing menu.
JSculley wrote: Thu Apr 27, 2023 11:00 am Turn off the directional lights, set the Scene to 'Plain White' and set the Ambient light 'Ambient' value to 1. If you do that, what's on the screen will match the RGB values of the appearance:
image.png
This helped. Apparently I had to change the Scene, there was probably something in the background of the default scene that was messing up my colors, even though the lightning was set up as you said. Changing the scene fixed it, and now the colors are appearing correctly. Thank you very much!
ryan-feeley
Posts: 82
Joined: Thu Jan 20, 2022 3:35 pm
Answers: 1
x 31
x 91

Re: Getting colors to appear realistically

Unread post by ryan-feeley »

Be aware that while yes, using only ambient light does make colors of faces match the color palette, if your goal is to "to set up some appearances in SW and find the best looking combination.", that may not be what you want to be doing.

Ambient light is a computationally cheap and somewhat believable way of faking indirect (diffuse) lighting. It adds a constant amount of light to every object from all directions, which gives uniform shading. That is why the face colors uniformly match the color palette.

But our eyes use differences in shading across the surface of an object to determine depth, so any object illuminated using only ambient light will not appear 3D. Imagine something outside on a very overcast day. The object has no depth and is pretty boring. So if you use ambient-only lighting in Solidworks, this will make it difficult for your on-screen display to truly be predictive of "best looking" or for "colors to appear as realistically as possible".

In my templates, I use mostly direct lighting, supported by a little ambient to fill in the gaps. Three direct lights are arranged more or less you would do a three-point lighting setup for product photography, with some adjustments that tailor the setup more towards part modeling than a photoshoot. I can share a scene file if you're interested.

This doesn't address any of the monitor color calibration issues discussed above, but it gets a little closer to a realistic appearance. In the physical world, most objects don't generate light. They just modify and reflect the color and magnitude of the environmental lighting back to your eyes. Solidworks can approximate this a bit. Generally more lights are better than fewer. Of the scenes included with Solidworks, only Studio Room 2 makes any sense at all. It has a soft background and three direct lights that remain fixed so you can rotate with the model within them to illuminate different aspects as you develop it.
User avatar
AlexB
Posts: 501
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 28
x 269
x 445

Re: Getting colors to appear realistically

Unread post by AlexB »

I've actually put together a macro to help with this on some of our files. It boosts the default settings of the scene. For those interested, the code is below.

Code: Select all

' Macro to delete all scene lights, and replace 3 directional and 1 ambient 
' with higher lighting values to produce colors closer to SW color palette
Option Explicit

Sub main()
    Dim swApp           As SldWorks.SldWorks
    Dim swModel         As SldWorks.ModelDoc2
    Dim i               As Integer
    Dim nLightCount     As Integer
    
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    
    If swModel Is Nothing Then
        MsgBox "A file must be open"
        Exit Sub
    ElseIf swModel.GetType = swDocDRAWING Then
        MsgBox "Macro can only be run on SLDPRT and SLDASM files"
        Exit Sub
    End If
    
    swModel.Extension.StartRecordingUndoObject
    
    nLightCount = swModel.GetLightSourceCount
    
    For i = nLightCount - 1 To 0 Step -1
        swModel.DeleteLightSource (i)
    Next i
    
    swModel.AddLightSource "Directional-1", 4, "Directional1"
    swModel.AddLightSource "Directional-2", 4, "Directional2"
    swModel.AddLightSource "Directional-3", 4, "Directional3"
    
    'Ambient Light
    swModel.SetLightSourcePropertyValuesVB "Ambient", 1, 0, 16777215, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.45, 0, 0, False
    swModel.LockLightToModel 0, True
    
    'Direction1 Light
    swModel.SetLightSourcePropertyValuesVB "Directional-1", 4, 0.4, 16777215, 1, -0.0415, 0.0436, 0.0135, 0, 0, 0, 0, 0, 0, 0, 0.1, 0.3, 0, False
    swModel.LockLightToModel 1, True
    
    'Direction2 Light
    swModel.SetLightSourcePropertyValuesVB "Directional-2", 4, 0.3, 16777215, 1, -0.0211, 0.0378, -0.044, 0, 0, 0, 0, 0, 0, 0, 0.1, 0.3, 0, False
    swModel.LockLightToModel 2, True
    
    'Direction3 Light
    swModel.SetLightSourcePropertyValuesVB "Directional-3", 4, 0.3, 16777215, 1, 7.1, 7.1, 4.35E-16, 0, 0, 0, 0, 0, 0, 0, 0.1, 0.3, 0, False
    swModel.LockLightToModel 3, True
        
    swModel.Extension.FinishRecordingUndoObject2 "Update Scene Lights", False
    
    swModel.GraphicsRedraw
    swModel.ForceRebuild3 True

End Sub
Edit: Credit to Deepak from quite a while ago
Mike Gera
Posts: 202
Joined: Mon Sep 06, 2021 1:29 pm
Answers: 0
x 91
x 36

Re: Getting colors to appear realistically

Unread post by Mike Gera »

JSculley wrote: Thu Apr 27, 2023 11:00 am Turn off the directional lights, set the Scene to 'Plain White' and set the Ambient light 'Ambient' value to 1. If you do that, what's on the screen will match the RGB values of the appearance:

image.png
That improves the color match, but then there's almost nothing left in the way of contrast. Everything in the part or assembly melts together.
SW 2024 SP 5.0
Windows 11
User avatar
SPerman
Posts: 2056
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 14
x 2227
x 1878
Contact:

Re: Getting colors to appear realistically

Unread post by SPerman »

After reading this, I followed JSculley's recommendation, but I have the Ambient set to .75. I find that to be a nice balance.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
Mike Gera
Posts: 202
Joined: Mon Sep 06, 2021 1:29 pm
Answers: 0
x 91
x 36

Re: Getting colors to appear realistically

Unread post by Mike Gera »

SPerman wrote: Fri Aug 25, 2023 1:46 pm After reading this, I followed JSculley's recommendation, but I have the Ambient set to .75. I find that to be a nice balance.
I tried ambient = 0.75, but everything still looks washed out.
SW 2024 SP 5.0
Windows 11
Post Reply