OpenNaja / cobra-tools

A suite of GUI tools for extracting and modifying OVL and OVS archives, as well as editing the associated in-house file formats. Also includes a model plugin for Blender. For downloads, guides, and FAQs visit:
https://opennaja.github.io/cobra-tools/
GNU General Public License v3.0
98 stars 28 forks source link

Blender - Shader Improvements #370

Open hexabits opened 8 months ago

hexabits commented 8 months ago

This ticket will track the creation and implementation of .blend files which house slottable NodeGroup setups for various shader features.

RGBA Improvements

Shader Attribute Support

Tex Channel Support

Improvement and implementation of .blend files

General

General Attributes vs Instanced attributes (custom properties)

I'm adding this after finding there is an issue with the way some dynamic attributes (e.g. flexicolours) are embedded in the shader: They are global to all materials, instead of instanced by each use of the material. The instanced attributes will require to move them to a panel using a data ref link.

AnimalVariation

Detail and Detail_Basic

FlexiDiffuse

MainShader

Elaboration: Every translucent material does not render well. Alpha Blend mode is never used afaict, and MainShader BSDF can only do certain clip shaders iirc. All glass shaders need a Translucent BSDF with Alpha Blend. Dissolve and TAAGroup4/6 clip shaders may be better using Alpha Hashed instead of Alpha Tested. Single and double sided transparency also needs to be dealt with for accurate rendering if there is currently no code to do so.

Correct Setup for Glass_Textured_Weather:

Glass_Textured_Weather

Creation of .blend files

DiffuseBlend

Transmission/Transmissive

Ice

Textures

'pAOTexture',
'pBaseDielectricSpecularLevelTexture',
'pBaseNormalTexture',
'pDetailNormalTexture',
'pDetailRoughnessTexture',
'pDiffuseTexture',
'pFlexiColourMasksTexture',
'pSubLayerDiffuse0Texture',
'pSubLayerDiffuse1Texture',
'pThicknessTexture',

Attributes

'pAngleDarkenPower': (0, [((1.0,), 2), ((0.5,), 1), ((1.25,), 1), ((0.6,), 1), ((1.2,), 1)]),
'pDetailNormalStrength': (0, [((0.5,), 4), ((1.0,), 1), ((0.35,), 1), ((0.3,), 1)]),
'pDetailTile': (0, [((3.0,), 4), ((2.0,), 2), ((8.0,), 1)]),
'pDiffuseTint': (2, [((1.0, 1.0, 1.0), 7)]),
'pDirectScatterTransmittance': (2, [((30.0, 1.0, 0.05), 1), ((16.2, 0.424, 0.075), 1), ((4.25, 0.8, 0.25), 1), ((11.1, 0.381, 0.2), 1), ((27.7, 0.27, 0.275), 1)]),
'pDirectionalLightTransmittanceOcclusion': (0, [((0.5,), 6), ((0.0025,), 1)]),
'pEnableRandomSubLayerOffset': (6, [((1,), 7)]),
'pIBLScatterTransmittanceSurfaceNormalDistortion': (0, [((0.1,), 4), ((0.5,), 1), ((0.4,), 1), ((0.072,), 1)]),
'pMaximumSnowAmount': (0, [((1.0,), 7)]),
'pMaximumWaterPermeability': (0, [((0.5,), 7)]),
'pNormalMapAngleDarkenStrength': (0, [((0.5,), 2), ((0.6,), 2), ((0.0,), 1), ((0.2,), 1), ((0.15,), 1)]),
'pNormalMapRefractionStrength': (0, [((1.0,), 4), ((0.5,), 1), ((0.8,), 1), ((0.4,), 1)]),
'pOpacityScale': (0, [((0.0,), 7)]),
'pRenderLayerOverride': (5, [((-1,), 7)]),
'pRoughnessRefractionStrength': (0, [((1.0,), 5), ((1.5,), 1), ((0.1,), 1)]),
'pSSAOScatterReflectionOcclusionStrength': (0, [((1.0,), 4), ((0.25,), 1), ((0.8,), 1), ((0.5,), 1)]),
'pSSRReflectionTransmittanceMip': (0, [((2.0,), 5), ((5.0,), 1), ((3.0,), 1)]),
'pSSRReflectionTransmittanceScale': (0, [((1.0,), 6), ((0.25,), 1)]),
'pSnowOnSlopesOffset': (0, [((0.0,), 1), ((0.094,), 1), ((0.063,), 1), ((0.422,), 1), ((0.14,), 1)]),
'pSubLayer0': (3, [((0.1, 0.0, 0.0, 0.0), 1), ((0.18, 0.1, 0.0, 0.0), 1), ((0.13, 0.125, 0.0, 0.0), 1), ((0.15, 0.125, 0.0, 0.0), 1), ((0.13, 0.07, 0.0, 0.0), 1)]),
'pSubLayer0DiffuseTint': (2, [((0.6705883, 0.8196079, 0.9019608), 6), ((1.0, 1.0, 1.0), 1)]),
'pSubLayer1': (3, [((0.2, 0.0, 0.0, 0.0), 1), ((0.031, 0.015, 0.0, 0.0), 1), ((0.051, 0.02, 0.0, 0.0), 1), ((0.041, 0.02, 0.0, 0.0), 1), ((0.046, 0.015, 0.0, 0.0), 1)]),
'pSubLayer1DiffuseTint': (2, [((0.9372549, 0.9803922, 1.0), 5), ((1.0, 1.0, 1.0), 2)]),
'pSubLayerAOMipBias': (0, [((4.0,), 2), ((4.5,), 2), ((1.0,), 1), ((5.0,), 1), ((5.75,), 1)]),
'pSubLayerAOStregnth': (0, [((1.0,), 4), ((1.25,), 2), ((2.0,), 1)]),
'pSubLayerOpacityMipBias': (0, [((1.0,), 5), ((4.0,), 1), ((5.0,), 1)]),
'pSubLayerTile': (0, [((8.0,), 1), ((1.0,), 1), ((0.4,), 1), ((1.3,), 1), ((0.9,), 1)]),
'pTransmittanceMinimum': (0, [((0.0,), 1), ((0.079,), 1), ((0.176,), 1), ((0.175,), 1), ((0.146,), 1)]),
'pTransmittanceScale': (0, [((1.0,), 2), ((0.74,), 1), ((0.2,), 1), ((0.5,), 1), ((0.3,), 1)]),

Moss

Textures

'pMossBaseColourRoughnessPackedTexture',
'pMossNormalTexture',
'pMossVarianceTexture',

Attributes

'pMossAmount': (0, [((1.0,), 51)]),
'pMossDielectricSpecularLevel': (0, [((0.025,), 51)]),
'pMossDiscolour': (2, [((0.8, 0.5, 0.5), 51)]),
'pMossDiscolourEdge': (0, [((0.43,), 48), ((0.258,), 1), ((0.394,), 1), ((1.0,), 1)]),
'pMossDiscolourRelativeToHeight': (6, [((1,), 49), ((0,), 2)]),
'pMossEdge': (0, [((0.5,), 46), ((0.409,), 1), ((0.267,), 1), ((0.089,), 1), ((0.2,), 1)]),
'pMossEdgeDetail': (0, [((0.5,), 48), ((0.9170001,), 1), ((0.274,), 1), ((0.09,), 1)]),
'pMossEdgeFalloff': (0, [((0.2,), 46), ((0.577,), 1), ((0.277,), 1), ((0.682,), 1), ((0.35,), 1)]),
'pMossEnabled': (6, [((0,), 46), ((1,), 5)]),
'pMossHeight': (0, [((1.0,), 48), ((1.482,), 1), ((2.553,), 1), ((0.6,), 1)]),
'pMossHeightVertexColourScale': (0, [((0.0,), 50), ((1.0,), 1)]),
'pMossPitch': (0, [((0.37,), 46), ((0.249,), 1), ((0.251,), 1), ((0.298,), 1), ((0.3,), 1)]),
'pMossSheenAmount': (0, [((1.4,), 48), ((2.679,), 1), ((2.769,), 1), ((3.632,), 1)]),
'pMossSheenTint': (2, [((1.0, 1.0, 0.5), 49), ((0.7793009, 0.7033896, 0.2044775), 1), ((0.6208915, 0.6208915, 0.2612682), 1)]),
'pMossTiling': (0, [((0.5,), 46), ((0.229,), 3), ((0.4,), 1), ((0.6,), 1)]),
'pMossVarianceAmount': (0, [((0.7,), 46), ((0.85,), 2), ((1.0,), 1), ((0.8980001,), 1), ((0.754,), 1)]),
'pMossVarianceEdge': (0, [((0.15,), 47), ((0.0,), 1), ((0.007,), 1), ((0.25,), 1), ((0.3,), 1)]),
'pMossVarianceEdgeFalloff': (0, [((0.2,), 51)]),
'pMossVarianceTiling': (0, [((0.5,), 48), ((0.6300001,), 1), ((2.2,), 1), ((1.2,), 1)]),
'pMossYaw': (0, [((0.04,), 49), ((0.028,), 1), ((0.1,), 1)]),

Iridescent

Textures

'pIridescenceStrength',
'pIridescenceTexture',

Attributes

None

ilodev commented 7 months ago

In regards to:

Doing a quick test yesterday if felt more natural to have a button (custom panel too) on the material properties to 'operate' that material. The button will clear out the existing material node tree and create a new one based on the available .blend files, pre-populate the fgm information and optionally pre-polate texture slots. The reason I metioned it feels more natural is because you delegate all the material creation/removal to blender, and we'll working on an existing material without having to replace materials on other objects/scenes/etc.

I'll start implementing this for a quick review of the workflow

hexabits commented 7 months ago

Example of Glass issues

Screenshot 2024-03-06 054803

At least for GlassWall but possibly all Glass* I have not verified yet.