Skip to content

add way to specify custom shaders #32

@bdpedigo

Description

@bdpedigo

would be nice to have a way to pass in custom shaders, e.g. for a skeleton in the segmentation layer. here's an example workaround I did just by modifying the JSON

shader = """
void main() {
    float compartment = vCustom2;
    vec4 uColor = segmentColor();
    emitRGB(uColor.rgb*0.5 + vec3(0.5, 0.5, 0.5) * compartment);
}
"""
skel_rendering_kws = {
    "shader": shader,
    "mode2d": "lines_and_points",
    "mode3d": "lines",
    "lineWidth3d": 1,
}

state_dict["layers"][1]["skeletonRendering"] = skel_rendering_kws

statebuilder.StateBuilder(base_state=state_dict, client=client).render_state(
    return_as="html"
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions