Scripting Support (C#)

advanced scripting

Beautify 3 (Built-in) · Scripting Support (C#)

Class: All members on this page belong to the Beautify component (namespace BeautifyEffect). Access via Beautify.instance or GetComponent<Beautify>().
Tip: All inspector properties are accessible via scripting. Check the demo scene scripts for runtime usage examples.

Getting Started

Beautify 3 for Built-in RP is a camera component. Access the singleton instance or get the component directly. Uses the BeautifyEffect namespace.

using BeautifyEffect;

Beautify b = Beautify.instance;
b.sharpen = 4f;
b.bloomIntensity = 0.5f;

Properties — General

static Beautify instance { get; }

Returns the active singleton Beautify instance.

BEAUTIFY_PRESET preset { get; set; }

Apply a built-in visual preset.

BEAUTIFY_QUALITY quality { get; set; }

Quality level affecting available features.

BeautifyProfile profile { get; set; }

Profile ScriptableObject for saving/loading settings.

Properties — Sharpen

float sharpen { get; set; }

Sharpening intensity.

float sharpenDepthThreshold { get; set; }

Depth threshold for edge-aware sharpening.

float sharpenRelaxation { get; set; }

Reduces sharpening on bright areas.

float sharpenClamp { get; set; }

Maximum sharpening clamp.

float sharpenMotionSensibility { get; set; }

Reduces sharpening during camera motion.

Properties — Color Grading

BEAUTIFY_TMO tonemap { get; set; }

Tonemapping operator.

float saturate { get; set; }

Color saturation.

float brightness { get; set; }

Overall brightness.

float contrast { get; set; }

Contrast adjustment.

Color tintColor { get; set; }

Global tint color.

bool lut { get; set; }

Enables LUT color grading.

float lutIntensity { get; set; }

LUT blend intensity.

Texture2D lutTexture { get; set; }

LUT texture.

Properties — Bloom

bool bloom { get; set; }

Enables bloom effect.

float bloomIntensity { get; set; }

Bloom intensity.

float bloomThreshold { get; set; }

Brightness threshold for bloom.

float bloomMaxBrightness { get; set; }

Maximum bloom brightness.

Color bloomTint { get; set; }

Bloom tint color.

Properties — Depth of Field

bool depthOfField { get; set; }

Enables depth of field.

float depthOfFieldDistance { get; set; }

Focus distance.

float depthOfFieldFocusSpeed { get; set; }

Focus transition speed.

bool depthOfFieldAutofocus { get; set; }

Enables autofocus (raycasts from viewport center).

Transform depthOfFieldTargetFocus { get; set; }

Target transform for focus tracking.

bool depthOfFieldBokeh { get; set; }

Enables bokeh effect.

float depthOfFieldCurrentFocalPointDistance { get; }

Read-only: current actual focal distance after autofocus/transitions.

Properties — Vignetting & Effects

bool vignetting { get; set; }

Enables vignetting.

float vignettingBlink { get; set; }

Blink/close-eyes amount.

bool outline { get; set; }

Enables edge outline.

bool nightVision { get; set; }

Enables night vision effect.

bool thermalVision { get; set; }

Enables thermal vision effect.

bool sunFlares { get; set; }

Enables sun flares.

bool lensDirt { get; set; }

Enables lens dirt.

bool eyeAdaptation { get; set; }

Enables automatic exposure adaptation.

bool chromaticAberration { get; set; }

Enables chromatic aberration.

Events

OnBeforeFocusEvent OnBeforeFocus(float currentFocusDistance)

Fired before the depth-of-field focus distance is applied. Your handler receives the current focus distance and returns the (optionally modified) distance to use.

// Delegate: float OnBeforeFocusEvent(float currentFocusDistance)

Beautify b = GetComponent<Beautify>();
b.OnBeforeFocus = (float distance) => {
    return Mathf.Clamp(distance, 1f, 100f);
};

Methods

void Blink(float duration, float maxValue = 1)

Triggers a blink animation (vignette close-open effect).

duration
Total blink duration in seconds.
maxValue
Maximum vignette value at peak blink (default 1).
void UpdateMaterialProperties()

Schedules a material property update. Call after changing multiple properties.

void UpdateMaterialPropertiesNow()

Forces an immediate material property update.

Code Examples

using BeautifyEffect;

Beautify b = Beautify.instance;

// Apply a preset
b.preset = BEAUTIFY_PRESET.Strong;

// Custom sharpening
b.sharpen = 5f;
b.sharpenRelaxation = 0.15f;

// Enable bloom
b.bloom = true;
b.bloomIntensity = 1f;
b.bloomThreshold = 0.8f;

// Depth of field with target tracking
b.depthOfField = true;
b.depthOfFieldTargetFocus = playerTransform;
b.depthOfFieldFocusSpeed = 0.3f;

// Blink effect
b.Blink(0.5f);

// Night vision mode
b.nightVision = true;
b.nightVisionColor = Color.green;
Was this page helpful?