← All ideas
  • Published 21 May 2023

Request for Implementation of a Readable Text/Markup-Based Shader Export/Import Feature

I'd like to propose an enhancement that could significantly streamline the process of creating, exporting, sharing, and importing shaders.

This concept revolves around introducing a text/markup readable/code format for Blender shaders, somewhat analogous to either CSS/HTML or Python

Feature Overview:

The idea is to devise a standardized format for expressing Blender shaders as text, allowing for easy copy-pasting and seamless exporting or sharing. This would further facilitate importing shaders from text or files, making collaboration and sharing in the Blender community more efficient and user-friendly.

It would also undoubtedly allow for AI tools to assist in the creation of complex shaders more easily.

Idealized Format and Functionality:

Taking cues from the syntax and structure of CSS and HTML, an idealized shader script could look something like this:

// Defining all the nodes independently ie: .Labelname[Nodetype]
.WoodGrain[NoiseTexture]{
    Scale: 5.830;
    Detail: 13.200;
    Roughness: 0.621;
    Distortion: 1.910;
}

.WoodColor[ColorRamp]{
    // Linked to WoodGrain's Fac
    Fac: WoodGrain.Fac;
    PosNodes(
        Pos: 0.382{
            Color: R: 0; G: 0; B: 0; A: 1;
        };
        Pos: 0.577{
            Color: R: 0.068426; G: 0.015894; B: 0.00202; A: 1;
        }
    )
}

.WoodBump[Bump]{
    // Linked to WoodColor's Color
    Fac: WoodColor.Color;
    Strength: 0.105;
    Distance: 0.300;
}

.WoodTexture[PrincipledBSDF]{
    // Linked to WoodColor's Color and WoodBump's Normal
    Base_Color: WoodColor.Color;
    Normal: WoodBump.Normal;
    Roughness: 0.214;
    Clearcoat: 0.268;
    Clearcoat_Roughness: 0.030;
}

// Establishing connections between nodes, Unnamednode short reference.
#MaterialOutput:Cycles{
    Surface: WoodTexture.BSDF;
}

The above shader would create: blender_8Ym4CKByGF.png

Video Example of copy-paste usecase:

Example Interaction with AI to create shaders:

  • Video: (Removed: Keep getting post hidden for links)

  • Image of chat: (Removed: Keep getting post hidden for links)

100%

Development Status: Open

Upvote 2 Downvote 0
psyda
21 May 2023

1 Comment

connor

very good idea!

1