We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Set Diffuse Color ignoring tonemapping/exposure

Home Forums Programming Set Diffuse Color ignoring tonemapping/exposure

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27216
    web
    Customer

    I need to create some materials on runtime, with a specific diffuse color. These colors need to match colors of the frontend in html.

    The problem I got now, is that because exposure/tonemapping affects the colors in 3d, the colors are way off the html elements.

    I tried to set “toneMapped”:false, but its still way off. I could just set a “BasicMaterial” so that its 100% self illuminated. But I need some kind of shading on the objects.

    This is my approach at the moment:
    object.material = new v3d.MeshStandardMaterial({ color: color, emissive: color, emissiveIntensity: 0.4, toneMapped: false });

    #27293

    Hi,

    If your color variable is specified with a hex value, e.g. ‘#fa820a’, then you probably need to convert it to a linear form by using Color.convertSRGBToLinear. For example:

    
    var color = new v3d.Color('#fa820a');
    color.convertSRGBToLinear();
    
    object.material = new v3d.MeshStandardMaterial({ color: color, emissive: color, emissiveIntensity: 0.4, toneMapped: false });
    

    I hope this helps.

    Co-founder and lead developer at Soft8Soft.

    #27310
    web
    Customer

    Awesome :yahoo:

    That worked! Thx heaps

    #27320

    Nice :good:

    Co-founder and lead developer at Soft8Soft.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.