How can i pass uint uniform

Hi guys
I found that i cannot pass uint uniform to ShaderMaterial by setInt, how can i do that, help please, thank you so much

Hello and welcome to the Babylon Community! Let me look at this.

thank you, playground: Simple vertex shader | Babylon.js Playground (babylonjs.com)

here is my workground use onBind | Babylon.js Playground (babylonjs.com)

shaderMaterial.onBind = (effect) => {
    engine._gl.uniform1ui(
        engine._gl.getUniformLocation(
            shaderMaterial.getEffect().getPipelineContext().program,
            'uintValue'
        ),
        1
    )
  
}

or add to uniform | Babylon.js Playground (babylonjs.com)

but i don’t think it’s a good solution

Hey! Sorry for not updating yesterday, but we’re adding the code to support this natively :slight_smile:

thanks for your help ^ ^

I have requested a PR
Add support for unsigned int uniform by newbeea · Pull Request #13433 · BabylonJS/Babylon.js (github.com)

2 Likes