Skip to content

WebGLRenderer: UBO / Uniform Buffer Object - Vec2 is not binded correctly. #28818

@dghez

Description

@dghez

Description

I'm trying to give a go to UBO / UniformBufferObject but I noticed one weird thing.
I'm setting a vec2 but looks like is keeping only one value (y) and set the other to 0

globalUniforms.resolution = new Uniform(new Vector2(11, 33))
globalUniforms.add(globalUniforms.resolution)

But if you check the screenshot, it's correct as vec2 of floats but as you can notice values are 33 and 0, instead of 11 and 33
image

After that i tried to bind a Vector3 and so far is binded correctly

globalUniforms.resolution = new Uniform(new Vector3(11, 33, 77))
globalUniforms.add(globalUniforms.resolution)
image

Reproduction steps

See above, explained in details

Code

// code goes here

Live example

Screenshots

No response

Version

0.166.0

Device

Desktop, Mobile

Browser

Chrome, Firefox

OS

MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions