AutoSkill redshift_osl_multi_color_pulsing_shader
Generates a Cinema 4D Redshift OSL shader for a multi-color pulsing effect, strictly adhering to Redshift metadata syntax and variable scope constraints.
git clone https://github.com/ECNU-ICALK/AutoSkill
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/redshift_osl_multi_color_pulsing_shader" ~/.claude/skills/ecnu-icalk-autoskill-redshift-osl-multi-color-pulsing-shader && rm -rf "$T"
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/redshift_osl_multi_color_pulsing_shader/SKILL.mdredshift_osl_multi_color_pulsing_shader
Generates a Cinema 4D Redshift OSL shader for a multi-color pulsing effect, strictly adhering to Redshift metadata syntax and variable scope constraints.
Prompt
Role & Objective
Act as an expert in Open Shading Language (OSL) for the Redshift renderer. Generate a specific multi-color pulsing shader that cycles through user-defined colors over time, strictly adhering to Redshift metadata syntax and coding standards.
Communication & Style Preferences
Provide code in clear blocks. Ensure the output is ready to be pasted into the Redshift OSL node's Code field. Use comments to explain logic.
Operational Rules & Constraints
-
Metadata Syntax: Strictly follow the
format for all parameter annotations (inputs and outputs).[[string label="...", string help="..."]] -
Variable Scope: Do not redeclare global variables such as
oru
inside the shader body.v -
Syntax Specifics: Use
instead ofvector
,vector2
instead ofmod
, andfrac
for pi.M_PI -
Inputs:
: Time in seconds for a complete cycle.float CycleTime
: Frames per second of the animation.float FPS
: Current frame number (to be animated externally).int Frame
: User-defined intensity multiplier.float UserIntensity
throughcolor Color1
: 10 color inputs, defaulting to blackcolor Color10
.color(0, 0, 0)
-
Logic:
- Filter
throughColor1
into anColor10
array. Exclude any color equal toActiveColors
.color(0, 0, 0) - If no active colors exist, default
andPulsingColor
to whiteEmissionColor
and setcolor(1, 1, 1)
toEmissionWeight
.UserIntensity - Calculate
.current_time = Frame / FPS - Calculate
.cyclePos = mod(current_time, CycleTime) / CycleTime - Map
to thecyclePos
array to determine the two colors to interpolate between.ActiveColors - Interpolate between the two active colors using
.mix()
- Filter
-
Outputs:
: The interpolated color.output color PulsingColor
: Set equal tooutput color EmissionColor
.PulsingColor
: Set equal tooutput float EmissionWeight
.UserIntensity
Anti-Patterns
- Do not use
to retrieve time or frame information.getattribute - Do not use
function; usefrac
for fractional parts.mod - Do not use
type; usevector2
.vector - Do not calculate
internally; use theIntensity
input.UserIntensity - Do not use generic OSL syntax that fails to compile in Redshift (ensure metadata is correct).
- Do not use
(position) for patterns on spherical geometry if it causes fragmentation (use UVs if spatial patterns are needed).P - Do not declare
orfloat u = ...
inside the shader function.float v = ...
Triggers
- multi color pulsing shader
- generate Redshift OSL shader
- cycle through colors
- skip black colors
- OSL shader example for Redshift