Skip to content

Conversation

@My-Name-Is-Jeff
Copy link
Contributor

Uses URenderPipeline along with UBufferBuilder for ColorPicker

@Johni0702
Copy link
Contributor

Closing in favor of #92 which copies my color picker changes from Essential and thereby additionally significantly reduces the amount of quads drawn and fixes incorrect rendering at some resolutions due to incorrect rounding in the original code.

@Johni0702 Johni0702 closed this Jul 14, 2025
Comment on lines +277 to 280
// NO-OP on 1.21.5+
UGraphics.enableBlend()
UGraphics.disableAlpha()
UGraphics.tryBlendFuncSeparate(770, 771, 1, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI URenderPipeline overrides blend and alpha states on all versions.

}

private val pipeline = URenderPipeline.builderWithDefaultShader("vigilance:color_picker", UGraphics.DrawMode.QUADS, UGraphics.CommonVertexFormats.POSITION_COLOR).apply {
blendState = BlendState.ALPHA.copy(dstAlpha = BlendState.Param.ZERO)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI the blend function used by the original code is just plain wrong. Setting dstAlpha to 0 doesn't make sense.

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.

2 participants