Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search

ShaderData preview is washed out in Material UI

Author
Message
  Topic Search Topic Search
peterakos View Drop Down
Member
Member


Joined: 2015 Jul 13
Online Status: Offline
Posts: 349
Direct Link To This Post Topic: ShaderData preview is washed out in Material UI
    Posted: 2018 Jun 28 at 7:16am

User Information:

Cinema 4D Version:   R18 
Platform:   Windows  ;   
Language(s):     C++  ;   

---------

Hello.

I have created a ShaderData plugin in which I use Output method to fill the preview.
The problem is that the shader preview appears very washed out in the Material UI.
In ShaderData plugin, the preview appears correctly because I have disabled Linear Workflow option from Project Settings, otherwise it's exactly the same.
How can I make the shader preview appeared correctly inside the Material UI as well. Is tehre any filter that I can disable via code ?

Thank you.
Back to Top
knickknack View Drop Down
Forum Moderator
Forum Moderator


Joined: 2016 Jul 01
Location: Italy
Online Status: Offline
Posts: 268
Direct Link To This Post Posted: 2018 Jul 02 at 3:48am
Hi Peterakos, thanks for writing us.

With reference to your question, and following a support email received on beginning May this year, I warmly invite to check if transforming from sRGB to linear already takes place if BaseShader::IsColorManagementOff() returns true.

I also remind you that, for your comfort, you can use TransformColor to transform your data from one colorspace to another.

Best, Riccardo
MAXON Computer GmbH
SDK Support Team
Back to Top
peterakos View Drop Down
Member
Member


Joined: 2015 Jul 13
Online Status: Offline
Posts: 349
Direct Link To This Post Posted: 2018 Jul 02 at 7:46am
Hello Riccardo.
Thank you very much for your help !

The call IsColorManagementOff returns false. The preview that I produce in output is correct (with Linear workflow off in Project Settings). The problem is that the material shows a washed out preview under ShaderLink. TransformColor doesn't help me in this case.

Thank you for your time.


Back to Top
knickknack View Drop Down
Forum Moderator
Forum Moderator


Joined: 2016 Jul 01
Location: Italy
Online Status: Offline
Posts: 268
Direct Link To This Post Posted: 2018 Jul 04 at 8:22am
Hi Peterakos, thanks for following up but it's indeed a matter of transforming the color you've selected in your shader from one space to another taking in consideration the fact that the linear workflow is enabled or not.

Using something as simple as

    Vector MyTransformColor(const Vector &color, const Int32 colorProfile, const Bool isLinearWF)
    {       
        if (colorProfile == DOCUMENT_COLORPROFILE_SRGB && isLinearWF)
            return TransformColor(color, COLORSPACETRANSFORMATION_SRGB_TO_LINEAR);
        else if (colorProfile == DOCUMENT_COLORPROFILE_LINEAR && !isLinearWF)
            return TransformColor(color, COLORSPACETRANSFORMATION_LINEAR_TO_SRGB);
       
        return color;
    }
could sort your problem out passing the color you've selected in the color picker out of your ShaderData in the ShaderData::Output() method.

Best, Riccardo
MAXON Computer GmbH
SDK Support Team
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.