AudioAsset
Ease
FastString
FontAsset
NineSlice
PackedSprite
PackedSpriteID
RB
   HardwareSettings
   IRetroBlitGame
RBAsset
Rect2i
ShaderAsset
SoundReference
SpriteGrid
SpriteSheetAsset
TMXMapAsset
   TMXLayer
   TMXLayerLoadState
   TMXObject
   TMXObjectGroup
   TMXProperties
Vector2i

ShaderAsset.PropertyID

Method  -  Static

public static int PropertyID(string name)

Parameters

name string Name of the property

Returns

int

Unique ID

Description

Get a unique ID of a shader property. Property IDs are more efficient than property name strings, and should be used instead for optimal performance.

Note that property IDs are tied to the property name, not to any particular shader. The same property ID can be used with multiple shaders that have the same property names.

Example

SpriteSheetAsset spritePackCharacters = new SpriteSheetAsset();
ShaderAsset shaderEffects = new ShaderAsset();

const int SHADER_PROP_GLOW = RB.ShaderPropertyID("glow");

void Initialize() {
    spritePackCharacters.Load("spritesheet/tiles");
    shaderEffects.Load("shaders/effects");
}

void Render() {
    RB.SpriteSheetSet(spritePackCharacters);

    // Draw a sprite with a shader effect
    RB.ShaderSet(shaderEffects);
    shaderEffects.ColorSet(SHADER_PROP_GLOW, Color.yellow);
    RB.DrawSprite("glowing_hero", glowingHeroPos);

    // Turn off shader and draw a sprite with default RetroBlit shader
    RB.ShaderReset();
    RB.DrawSprite("boring_hero", boringHeroPos);
}

See Also

RB.ShaderSet
RB.ShaderApplyNow
RB.ShaderReset
ShaderAsset.ColorSet
ShaderAsset.ColorArraySet
ShaderAsset.FloatSet
ShaderAsset.IntSet
ShaderAsset.MatrixSet
ShaderAsset.MatrixArraySet
ShaderAsset.VectorSet
ShaderAsset.VectorArraySet
ShaderAsset.SpriteSheetTextureSet
ShaderAsset.SpriteSheetFilterSet

See Docs

Features - Shaders (Advanced Topic)