Skip to content

Adds typed uniforms to ShaderMaterial and RawShaderMaterial#1579

Open
haxiomic wants to merge 4 commits intothree-types:masterfrom
haxiomic:patch-1
Open

Adds typed uniforms to ShaderMaterial and RawShaderMaterial#1579
haxiomic wants to merge 4 commits intothree-types:masterfrom
haxiomic:patch-1

Conversation

@haxiomic
Copy link

@haxiomic haxiomic commented Mar 19, 2025

I've been using this for years in my own projects where I use custom shaders often. Typing uniforms makes working with these classes much nicer

let shader = new ShaderMaterial({ uniforms: { example: new Uniform(3), ... }, ... });

// typed correctly!
shader.uniforms.example.value = 4

This does not change the behaviour of existing code because uniform types default to any

@haxiomic
Copy link
Author

I'll add Defines types before this is complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant