Print at Dec 20, 2025, 8:18:58 PM
Posted by UbuntuBirdy at Oct 19, 2018, 8:18:12 PM
massive color-difference
For a long time I have been wondering what the color difference between the two lower (1 & 2) and the two upper (3 & 4) rendering levels is all about.
As in the lower levels, I select the colors, read them from a picture or compare them with a pattern.
When rendering in the upper levels, the colors are too bright and far away from what I chose.
I've tried so much and I do not know how to continue. Is there a workaround?


Level 1 - How I wish it should be (Red)


Level 3 - How it turns out (Red)

I would be so grateful for a solution ...
----------------------------------------
Pascal

SH3D 6.6 / Ubuntu 22.04 (Mainline-Kernel) / Radeon RX580 / Ryzen 7 5800x

Posted by hal9000 at Oct 21, 2018, 12:01:39 PM
Re: massive color-difference
Could it be the material shininess? The ship material seems to be too reflective. Look at the white part at the ship's rear left corner. It's reflecting the illuminated zone of the floor. Look at the floor below the table and chairs too. It's reflecting the leg of the chairs.

I think that's the cause of the color change. Try to adjust the shininess on the material and it should help.
----------------------------------------
If a long walk every day were healthy, mailmen would be immortal. tongue

Posted by UbuntuBirdy at Oct 21, 2018, 1:39:40 PM
Re: massive color-difference
Unfortunately this is not the reason.


In this picture the whole back deck (the upper red part) is set to matt and it's not even a bit better.
----------------------------------------
Pascal

SH3D 6.6 / Ubuntu 22.04 (Mainline-Kernel) / Radeon RX580 / Ryzen 7 5800x

Posted by Puybaret at Oct 21, 2018, 2:35:42 PM
Re: massive color-difference
From the length of the shadows, I think you chose a quite late hour of the day which produces a yellow color. Try at another hour, or even choose a night hour and add some white lights.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by alaX at Oct 21, 2018, 2:48:33 PM
Re: massive color-difference
My suggestion - check ambient/specular color and illumination model in .mtl file. I can't test it now - today nothing's working as it should

Posted by UbuntuBirdy at Oct 21, 2018, 2:58:04 PM
Re: massive color-difference
Time is set to noon, but in October.

So, I rendered a picture at 12:07 on 21.06.2018, the highest point of the sun this year:


And one at 23:22 on 21.12.2018, the middle of the longest night this year with a light panel above the boat:


Even in this dark night, you can see, the red colour is not as it should be...
----------------------------------------
Pascal

SH3D 6.6 / Ubuntu 22.04 (Mainline-Kernel) / Radeon RX580 / Ryzen 7 5800x

Posted by UbuntuBirdy at Oct 21, 2018, 3:09:12 PM
Re: massive color-difference
@alaX - I do not know exactly, which value is for this effect and I do absolutely not know how it should be:
illum 2
Ka 0.32156864 0.0 0.08235294
Kd 0.32156864 0.0 0.08235294
Ks 0.5 0.5 0.5
Ns 64.0

----------------------------------------
Pascal

SH3D 6.6 / Ubuntu 22.04 (Mainline-Kernel) / Radeon RX580 / Ryzen 7 5800x

Posted by hal9000 at Oct 21, 2018, 4:04:44 PM
Re: massive color-difference
I noticed that the table and chairs, which are textured, are more similar between the two render modes.

More as a test or possible workaround (if it works) than a definitive solution, could you make a little bitmap containing only the plain color that you want to use and then use it as a texture for the material? I wonder if it will be processed the same way... thinking
----------------------------------------
If a long walk every day were healthy, mailmen would be immortal. tongue

Posted by UbuntuBirdy at Oct 21, 2018, 4:18:47 PM
Re: massive color-difference
I noticed that the table and chairs, which are textured, are more similar between the two render modes.

More as a test or possible workaround (if it works) than a definitive solution, could you make a little bitmap containing only the plain color that you want to use and then use it as a texture for the material? I wonder if it will be processed the same way... thinking

Easy and simple idea - and it totally works!!!

For me this is a workaround and I can live with this as a solution, but I'm still wondering what's the issue with the colour...
----------------------------------------
Pascal

SH3D 6.6 / Ubuntu 22.04 (Mainline-Kernel) / Radeon RX580 / Ryzen 7 5800x

Posted by hansmex at Oct 21, 2018, 5:58:27 PM
Re: massive color-difference
Great result, great solution !!!!!
----------------------------------------
Hans

new website - under constuction
hansdirkse.info

Posted by hal9000 at Oct 21, 2018, 6:08:13 PM
Re: massive color-difference
Easy and simple idea - and it totally works!!!

For me this is a workaround and I can live with this as a solution, but I'm still wondering what's the issue with the colour...


Glad to know. I'm wondering it too. May be Emmanuel can explain it, although I'm not sure whether it's a SH3D or SunFlow issue.
----------------------------------------
If a long walk every day were healthy, mailmen would be immortal. tongue

Posted by Puybaret at Oct 21, 2018, 6:23:19 PM
Re: massive color-difference
Nobody complained until now but it's clearly an issue that should be fixed if possible, particularly if the rendering is different with a similar texture.
Please, open a bug ticket.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by UbuntuBirdy at Oct 21, 2018, 6:40:06 PM
Re: massive color-difference
Please, open a bug ticket.

...done.
----------------------------------------
Pascal

SH3D 6.6 / Ubuntu 22.04 (Mainline-Kernel) / Radeon RX580 / Ryzen 7 5800x

Posted by Puybaret at Oct 21, 2018, 10:06:58 PM
Re: massive color-difference
Thanks. I will investigate...
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by Ceciliabr at Oct 26, 2018, 5:48:16 PM
Re: massive color-difference
but I'm still wondering what's the issue with the colour...
There's really no issue:
The reflected colours change as the light changes – just as in real life.



To best manage colours, the first thing you should do is to calibrate the brightness of your 3d view,
if you haven't done that already:
Apply a completely white texture to the sky.
Render different coloured objects with enhance external brightness checked, and no sunlight.



Adjust the brightness of the 3D view until the brightness is as close to the rendered image as possible.

_______

I find that applying a white top to a partly clouded sky image, is a good way to get nice daylight colours when using the enhanced brightness option.



cec

Posted by UbuntuBirdy at Oct 26, 2018, 7:35:29 PM
Re: massive color-difference
Sorry cec, but this IS an issue! Such massive differences are NOT like in real life.
Of course I have tried to adjust all the params, but none of them has improved the condition.
And why are texture colours not the same as only colours?
----------------------------------------
Pascal

SH3D 6.6 / Ubuntu 22.04 (Mainline-Kernel) / Radeon RX580 / Ryzen 7 5800x

Posted by UbuntuBirdy at Oct 26, 2018, 8:42:33 PM
Re: massive color-difference
This picture shows what's wrong in my opinion:

- The left cube has a texture which is only colored as #520015
- The right cube has the color #520015 directly

In my opinion both cubes should look the same, we should see exactly the same color. But only the textured cube shows the color #520015 as it should be.
----------------------------------------
Pascal

SH3D 6.6 / Ubuntu 22.04 (Mainline-Kernel) / Radeon RX580 / Ryzen 7 5800x

Posted by Ceciliabr at Oct 26, 2018, 10:02:27 PM
Re: massive color-difference
You are absolutely right!
I totally misunderstood the problem.


Here is a test with white, showing the opposite effect between the preview and the rendered image.





cec

Posted by UbuntuBirdy at Oct 26, 2018, 10:33:11 PM
Re: massive color-difference
I think it makes sense to post the link to the bug ticket.
This way anyone can add further informations regarding the problem.
----------------------------------------
Pascal

SH3D 6.6 / Ubuntu 22.04 (Mainline-Kernel) / Radeon RX580 / Ryzen 7 5800x

Posted by Superpippo at Nov 16, 2018, 3:12:34 PM
Re: massive color-difference
Problema simile ... Cielo costantemente rosso anche se cambio colori o Texture se faccio foto in modalità 3 o 4 ... parzialmente risolto : 1) mettere in modalità visita virtuale 2) alzare la testa dell'omino e inquadrare solo il cielo 3) fare una foto in modalità 3 o 4 e vedere se il colore si è resettato e il cielo è tornato blu 4) abbassare gradualmente la testa continuando a verificare che tutto sia tornato a posto 5) vedere con l'inquadratura giusta gli sfondi sono tornati normali 6) fare la stessa verica con l'inquadratura 3d aerea 7) cambiare i punti cardinali o inserire una luce bianca se alcune Texture danno sul giallo

Posted by Mike53 at Nov 16, 2018, 10:49:44 PM
Re: massive color-difference
Not so sure this is a new topic, i seem to recall questioning it a couple of years ago, i have found that using textures is far more accurate than colors, here are 2 images, 1 a screenshot the other a render.

and this is a Q4 render

not only does the red change to pink but it also shows how different objects color differently, the I beams are rooms and the roller support brackets are box's, both have the same color applied to them.
Mike

Posted by hal9000 at Dec 6, 2019, 8:05:17 PM
Re: massive color-difference
Well, more than 1 year after the last post, but... Has somebody tried to render one of these projects with YafaRay to see if the color difference between a pure color and a texture of the same color is still there?
----------------------------------------
If a long walk every day were healthy, mailmen would be immortal. tongue

Posted by UbuntuBirdy at Dec 7, 2019, 11:26:30 AM
Re: massive color-difference
Interesting idea. Yes, I have, but unfortunately I have changed all my projects from colored to textured objects.
But I will this give a try.
----------------------------------------
Pascal

SH3D 6.6 / Ubuntu 22.04 (Mainline-Kernel) / Radeon RX580 / Ryzen 7 5800x

Posted by enkonyito at Dec 13, 2019, 2:28:20 AM
Re: massive color-difference
@UbuntuBirdy
This picture shows what's wrong in my opinion:

- The left cube has a texture which is only colored as #520015
- The right cube has the color #520015 directly

In my opinion both cubes should look the same, we should see exactly the same color. But only the textured cube shows the color #520015 as it should be.

I think the difference comes from the way Java 3D processes colors or textures.

Example of rendering in quality 1.


Enko
----------------------------------------
EnkoNyito

Posted by Mike53 at Feb 21, 2021, 11:24:25 AM
Re: massive color-difference
Not sure if this issue has been attended to but i am still getting the same issue

Roof with colour:-



Roof with texture:-



Posted by hansmex at Feb 21, 2021, 11:40:35 AM
Re: massive color-difference
This is a known "problem". Using an even-coloured texture is the solution, as you already found out.

H
----------------------------------------
Hans

new website - under constuction
hansdirkse.info

Posted by Mike53 at Feb 21, 2021, 1:16:11 PM
Re: massive color-difference
Just because it is something that is a "KNOWN PROBLEM" shouldn't mean we have to continue with "work arounds" rather than sorting the issues.
As a maintenance engineer i quite often use "work arounds" when needed to get a machine running, but, these are temporary, I return as soon as possible to properly make repair.

Posted by reddy.shyam at Feb 26, 2021, 6:47:43 AM
Re: massive color-difference
While we are at it, is my issue same as well? All my bright colors become pale when I generate an image. Please see attached.

Any setting I need to change while generating image?



Cannot attach any image host files for some reason. Tried imgur and prnt.sc`

Posted by kutlu9 at Mar 14, 2021, 8:20:22 AM
Re: massive color-difference
I'm having same problem as reddy.shyam. I was using the programm without any problems, suddenly my images become over exposed. Uninstall/reinstall didn't solved it.

I noticed sky texture or color doesn't render (rendering with only pure white color) making final image over exposed.

Posted by c0d3z3r0 at Dec 27, 2024, 8:40:17 PM
Re: massive color-difference
The problem seems to be that Java3D expects Linear RGB as input color space:https://forum.jogamp.org/sRGB-and-gamma-correction-in-Java3d-td4038946.html

I've tested this by manually setting the RGB value of a wall to a gamma-corrected value ( lin=255*(val/255, 2.2) ), which makes yafaray and sunflow output the correct color.

There are two options: 1) feed in a generated texture or 2) convert the colors to linear RGB

Posted by c0d3z3r0 at Dec 27, 2024, 9:21:53 PM
Re: massive color-difference
Ok... it was easier to fix than expected \o/

Patch:
diff --git a/SweetHome3D/src/com/eteks/sweethome3d/j3d/PhotoRenderer.java b/SweetHome3D/src/com/eteks/sweethome3d/j3d/PhotoRenderer.java
index c95e11a94..56ca69c87 100644
--- a/SweetHome3D/src/com/eteks/sweethome3d/j3d/PhotoRenderer.java
+++ b/SweetHome3D/src/com/eteks/sweethome3d/j3d/PhotoRenderer.java
@@ -1273,7 +1273,8 @@ public class PhotoRenderer extends AbstractPhotoRenderer {
if (material != null) {
Color3f color = new Color3f();
material.getDiffuseColor(color);
- this.sunflow.parameter("color", null, new float [] {color.x, color.y, color.z});
+ this.sunflow.parameter("color", null, new float [] {(float)Math.pow(color.x, 2.2f),(float)Math.pow(color.y, 2.2f),(float)Math.pow(color.z, 2.2f)
+ });
}
this.sunflow.shader(appearanceName, "mirror");
} else if (texture != null) {
@@ -1321,7 +1322,7 @@ public class PhotoRenderer extends AbstractPhotoRenderer {
Color3f color = new Color3f();
material.getSpecularColor(color);
float [] specularColor = new float [] {
- (float)Math.sqrt(color.x) / 2, (float)Math.sqrt(color.y) / 2, (float)Math.sqrt(color.z) / 2};
+ (float)Math.sqrt((float)Math.pow(color.x, 2.2f)) / 2, (float)Math.sqrt((float)Math.pow(color.y, 2.2f)) / 2, (float)Math.sqrt((float)Math.pow(color.z, 2.2f)) / 2};
this.sunflow.parameter("specular", null, specularColor);
this.sunflow.parameter("glossyness", (float)Math.pow(10, -Math.log(shininess) / Math.log(5)));
this.sunflow.parameter("samples", 1);
@@ -1340,7 +1341,7 @@ public class PhotoRenderer extends AbstractPhotoRenderer {
if (material != null) {
Color3f color = new Color3f();
material.getDiffuseColor(color);
- float [] diffuseColor = new float [] {color.x, color.y, color.z};
+ float [] diffuseColor = new float [] {(float)Math.pow(color.x, 2.2f),(float)Math.pow(color.y, 2.2f),(float)Math.pow(color.z, 2.2f)};

TransparencyAttributes transparencyAttributes = appearance.getTransparencyAttributes();
if (transparencyAttributes != null
@@ -1373,7 +1374,7 @@ public class PhotoRenderer extends AbstractPhotoRenderer {
if (silk) {
material.getSpecularColor(color);
float [] specularColor = new float [] {
- (float)Math.sqrt(color.x) / 2, (float)Math.sqrt(color.y) / 2, (float)Math.sqrt(color.z) / 2};
+ (float)Math.sqrt((float)Math.pow(color.x, 2.2f)) / 2, (float)Math.sqrt((float)Math.pow(color.y, 2.2f)) / 2, (float)Math.sqrt((float)Math.pow(color.z, 2.2f)) / 2};
this.sunflow.parameter("specular", null, specularColor);
this.sunflow.parameter("glossyness", (float)Math.pow(10, -Math.log(shininess) / Math.log(5)));
this.sunflow.parameter("samples", 1);
@@ -1394,7 +1395,7 @@ public class PhotoRenderer extends AbstractPhotoRenderer {
if (coloringAttributes != null) {
Color3f color = new Color3f();
coloringAttributes.getColor(color);
- this.sunflow.parameter("color", null, new float [] {color.x, color.y, color.z});
+ this.sunflow.parameter("color", null, new float [] {(float)Math.pow(color.x, 2.2f),(float)Math.pow(color.y, 2.2f),(float)Math.pow(color.z, 2.2f)});
} else {
this.sunflow.parameter("color", null, new float [] {0, 0, 0});
}
diff --git a/SweetHome3D/src/com/eteks/sweethome3d/j3d/YafarayRenderer.java b/SweetHome3D/src/com/eteks/sweethome3d/j3d/YafarayRenderer.java
index b0a3e69e5..97da951e6 100644
--- a/SweetHome3D/src/com/eteks/sweethome3d/j3d/YafarayRenderer.java
+++ b/SweetHome3D/src/com/eteks/sweethome3d/j3d/YafarayRenderer.java
@@ -1439,7 +1439,7 @@ public class YafarayRenderer extends AbstractPhotoRenderer {
if (material != null) {
material.getDiffuseColor(color);
}
- params.put("mirror_color", new float [] {color.x, color.y, color.z, 1});
+ params.put("mirror_color", new float [] {(float)Math.pow(color.x, 2.2f),(float)Math.pow(color.y, 2.2f),(float)Math.pow(color.z, 2.2f), 1});
params.put("specular_reflect", 1f);
createMaterial(appearanceName, params, new ArrayList<Map<String, Object>>());
} else if (texture != null) {
@@ -1604,32 +1604,32 @@ public class YafarayRenderer extends AbstractPhotoRenderer {
float transparency = 1 - transparencyAttributes.getTransparency();
params.put("type", "glass");
params.put("fake_shadows", true);
- params.put("filter_color", new float [] {color.x, color.y, color.z, 1});
+ params.put("filter_color", new float [] {(float)Math.pow(color.x, 2.2f),(float)Math.pow(color.y, 2.2f),(float)Math.pow(color.z, 2.2f), 1});
params.put("transmit_filter", transparency);
} else if (material.getLightingEnable()) {
float shininess = material.getShininess();
if (shininess > 1) {
if (silk) {
- params.put("diffuse_color", new float [] {color.x, color.y, color.z, 1});
+ params.put("diffuse_color", new float [] {(float)Math.pow(color.x, 2.2f),(float)Math.pow(color.y, 2.2f),(float)Math.pow(color.z, 2.2f), 1});
params.put("diffuse_reflect", 1.5f);
material.getSpecularColor(color);
- params.put("color", new float [] {color.x, color.y, color.z, 1});
+ params.put("color", new float [] {(float)Math.pow(color.x, 2.2f),(float)Math.pow(color.y, 2.2f),(float)Math.pow(color.z, 2.2f), 1});
params.put("glossy_reflect", shininess / 256f);
params.put("exponent", 100f);
params.put("type", "glossy");
} else {
- params.put("color", new float [] {color.x, color.y, color.z, 1});
+ params.put("color", new float [] {(float)Math.pow(color.x, 2.2f),(float)Math.pow(color.y, 2.2f),(float)Math.pow(color.z, 2.2f), 1});
params.put("specular_reflect", shininess / 512f);
- params.put("mirror_color", new float [] {color.x, color.y, color.z, 1});
+ params.put("mirror_color", new float [] {(float)Math.pow(color.x, 2.2f),(float)Math.pow(color.y, 2.2f),(float)Math.pow(color.z, 2.2f), 1});
params.put("type", "shinydiffusemat");
}
} else {
- params.put("color", new float [] {color.x, color.y, color.z, 1});
+ params.put("color", new float [] {(float)Math.pow(color.x, 2.2f),(float)Math.pow(color.y, 2.2f),(float)Math.pow(color.z, 2.2f), 1});
params.put("type", "shinydiffusemat");
}
} else {
params.put("type", "light_mat");
- params.put("color", new float [] {color.x, color.y, color.z, 1});
+ params.put("color", new float [] {(float)Math.pow(color.x, 2.2f),(float)Math.pow(color.y, 2.2f),(float)Math.pow(color.z, 2.2f), 1});
if (lightPower >= 0) {
params.put("power", lightPower * 100);
}
@@ -1641,7 +1641,7 @@ public class YafarayRenderer extends AbstractPhotoRenderer {
if (coloringAttributes != null) {
Color3f color = new Color3f();
coloringAttributes.getColor(color);
- params.put("color", new float [] {color.x, color.y, color.z, 1});
+ params.put("color", new float [] {(float)Math.pow(color.x, 2.2f),(float)Math.pow(color.y, 2.2f),(float)Math.pow(color.z, 2.2f), 1});
} else {
params.put("color", new float [] {0, 0, 0, 1});
}