Incorrect 'Convert Materials' Results

Forums: Incorrect 'Convert Materials' Results
Sub forum for bug reports

Moderator: aoktar

Forum rules
Before posting a bug report, please check the following:
1. That the issue has not already been disclosed
2. That the issue is specific to this plugin, and not Octane in general (Try reproducing it in Standalone)
Bugs related to the Octane Engine itself should be posted into the Standalone Support sub-forum.


All bug reports should include the information below, along with a detailed description of the issue and steps to reproduce it.
A. Operating System, including version (i.e. Win 7, OSX 10.11.2, Ubuntu 14.04, etc.)
B. Graphics Card(s) model (i.e. GTX 580 - 3GB, TITAN, etc.)
C. RAM Capacity (i.e. 6 GB)
D. Nvidia driver version (i.e. 7.50, 7.5.22)
E. OctaneRender Standalone version, if installed (i.e. 2.24.2, 2.23, etc.)
F. OctaneRender plugin version (i.e. v2.25 - 2.21)
G. Host application version, including build number if available (i.e. 3ds Max 2016 Build 18.0)
H. A detailed description of the issue and steps to reproduce it (Include Screenshots or video capture), as well as an example scene if applicable.
I. Copies of the Octane Log window and Console window outputs (full text attached as a file to your post is recommended).


Please note that reports of issues inside existing threads will be ignored/removed, and reports may be closed if the reporter does not respond to subsequent queries in the thread.

Incorrect 'Convert Materials' Results

Postby blastframe » Sat Sep 26, 2020 7:23 pm

blastframe Sat Sep 26, 2020 7:23 pm
A. Operating System, including version (i.e. Win 7, OSX 10.11.2, Ubuntu 14.04, etc.)
Windows 10.0.19041

B. Graphics Card(s) model (i.e. GTX 580 - 3GB, TITAN, etc.)
TITAN Black

C. RAM Capacity (i.e. 6 GB)
64GB

D. Nvidia driver version (i.e. 7.50, 7.5.22)
456.38

E. OctaneRender Standalone version, if installed (i.e. 2.24.2, 2.23, etc.)
2020.1.5

F. OctaneRender plugin version (i.e. v2.25 - 2.21)
2020.1.5-R2

G. Host application version, including build number if available (i.e. 3ds Max 2016 Build 18.0)
Cinema 4D R23.008

H. A detailed description of the issue and steps to reproduce it (Include Screenshots or video capture), as well as an example scene if applicable.

1. Convert Materials produces incorrect values for Specular color:
In a PBR Material with one Reflectance layer, the Layer Color is white. When using Octane's Convert Materials command, the Specular Color is incorrect:
PBR_Specular.jpg
Cinema 4D PBR Specular Color

Octane_result.jpg
Octane Convert Materials Result: Specular


2. Metallic PBR Materials do not use Metallic Octane Materials or BRDF Model
Also, though the PBR Reflectance Attenuation is set to 'Metal', the Convert Materials result does not use 'Metallic' or 'Universal' as the Material type nor the correct BRDF model, so metals do not get converted properly.
C4D_Metal.jpg
Cinema 4D PBR Metal

Octane_Metal.jpg
Octane Convert Materials Result: Metal


Here is a scene file with 10 PBR materials that were converted incorrectly with Octane's Convert Materials (this is using the Robot rig from Cinema 4D's Content Browser Presets):
https://drive.google.com/drive/folders/ ... sp=sharing
User avatar
blastframe
Licensed Customer
Licensed Customer
 
Posts: 178
Joined: Wed May 21, 2014 6:01 am
Location: Los Angeles, CA USA

Re: Incorrect 'Convert Materials' Results

Postby aoktar » Sat Sep 26, 2020 10:06 pm

aoktar Sat Sep 26, 2020 10:06 pm
Everything is not supported with converter. It's pretty old. And there's not matching concept to make proper conversions between these.
Octane For Cinema 4D developer / 3d generalist

3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
User avatar
aoktar
Octane Plugin Developer
Octane Plugin Developer
 
Posts: 15965
Joined: Tue Mar 23, 2010 8:28 pm
Location: Türkiye

Re: Incorrect 'Convert Materials' Results

Postby blastframe » Sat Sep 26, 2020 11:10 pm

blastframe Sat Sep 26, 2020 11:10 pm
aoktar wrote:Everything is not supported with converter. It's pretty old. And there's not matching concept to make proper conversions between these.


Okay. Can you please either remove this broken feature or make the result a better approximation? As Maxon improves its Viewport, it makes using PBR for early visualization of a project before Octane a good option. A more helpful conversion would save a lot of time.

This is a super crude script, but assuming the user is using the Default PBR setup (one Diffuse layer and one Reflection layer in the Reflectance channel), it would set the Specular color correctly and the BRDF Model. I know it's not exact and there could be a lot of variations, but adjusting one Reflectance layer would be closer than the current command.

Code: Select all
import c4d

def createOctMaterial(pbrMat,metallic=False):
    if not metallic:
        c4d.CallCommand(1033893) # Octane Glossy Material
    else:
        c4d.CallCommand(1041569) # Octane Universal Material
       
    octMat = doc.GetFirstMaterial()
    doc.AddUndo(c4d.UNDOTYPE_NEW,octMat)
    doc.AddUndo(c4d.UNDOTYPE_CHANGE,octMat)
    octMat[c4d.ID_BASELIST_NAME] = pbrMat.GetName()
    return octMat

def getPBRSpecularLayer(mat):
    cntLayer = mat.GetReflectionLayerCount()
    for i in range(0, cntLayer):
        layer = mat.GetReflectionLayerIndex(i)
        if mat.GetName() == "Default Reflection":
            return layer.GetDataID()
        else:
            layer = mat.GetReflectionLayerIndex(0)
    return layer.GetDataID()

def main(doc):
    pbrMat = doc.GetActiveMaterial()
    if pbrMat != None:
        doc[c4d.DOCUMENT_COLORPROFILE] = 0
        reflectionLayerID = getPBRSpecularLayer(pbrMat)

        if pbrMat[reflectionLayerID + c4d.REFLECTION_LAYER_MAIN_DISTRIBUTION] == c4d.REFLECTION_DISTRIBUTION_BECKMANN:
            octMat = createOctMaterial(pbrMat,True)
            octMat[c4d.OCT_MATERIAL_SPECULAR_COLOR] = pbrMat[reflectionLayerID + c4d.REFLECTION_LAYER_COLOR_COLOR]
            octMat[c4d.OCT_MATERIAL_TYPE] = c4d.OCT_MAT_UNIVERSAL
            octMat[c4d.OCT_MAT_BRDF_MODEL] = c4d.OCT_MAT_BRDF_BECKMANN
        elif pbrMat[reflectionLayerID + c4d.REFLECTION_LAYER_MAIN_DISTRIBUTION] == c4d.REFLECTION_DISTRIBUTION_GGX:
            octMat = createOctMaterial(pbrMat,True)
            octMat[c4d.OCT_MATERIAL_SPECULAR_COLOR] = pbrMat[reflectionLayerID + c4d.REFLECTION_LAYER_COLOR_COLOR]
            octMat[c4d.OCT_MATERIAL_TYPE] = c4d.OCT_MAT_UNIVERSAL
            octMat[c4d.OCT_MAT_BRDF_MODEL] = c4d.OCT_MAT_BRDF_GGX

    c4d.EventAdd()

if __name__=='__main__':
    main(doc)
User avatar
blastframe
Licensed Customer
Licensed Customer
 
Posts: 178
Joined: Wed May 21, 2014 6:01 am
Location: Los Angeles, CA USA

Return to Bug Reports


Who is online

Users browsing this forum: No registered users and 4 guests

Tue Apr 23, 2024 6:22 pm [ UTC ]