Skip to content

Any way to set GLSL uniform arrays? #468

@DruggedBunny

Description

@DruggedBunny

Hi Mark,

I'm attempting to shove a bunch of palette values from Monkey2 side into a uniform array, but as far as I can tell, that's not currently possible as we don't have the relevant SetXXXArray option. (Did consider abusing SetMat4fArray, but... )

Naive attempt with floats! Would be looking to fill in vec3s or maybe just floats (hsl hue values) in my case...

	' OK, this wasn't gonna happen!

	TargetImage.Material.SetFloat	("m_Test[0]", 0.0)
	TargetImage.Material.SetFloat	("m_Test[1]", 1.0)

	' GLSL side:

	uniform float m_Test [2];

	if (m_Test[1] > 0.0)
	
	' Nope!

I'm avoiding sending the palette texture as I would need to do up to 8, 16... maybe even 256 texture lookups per-pixel for closest-colour selection, depending on fake retro-palette, and one thing I've learned is that this is slow, whereas a quick iteration through float or vec3 arrays ought to be fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions