Color blend shader for triangles and text #1460
Unanswered
rickyjames35
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My goal in a nutshell is to create a basic shader that allows me to blend/modify the vertex colors using a descriptor. I'm really just trying to dynamically change the alpha value at runtime but blending the whole color gives me the same effect with a ability to adjust any channel. I would also like to be able to do the same with text. I have it working with basic shapes but not text. Here is my vert shader.
Here is my
vsg::ShaderSet
.Here's me creating 3 triangles using the shader set along with a descriptor per triangle. The last triangle is setup to allow me to dynamically blend the color during runtime.
Here is the result
Screencast from 05-06-2025 05:57:41 PM.webm
I'm new to VSG so I'm likely missing out on best practices or easier ways to go about doing this. For example is seems strange to me that I had to bypass using
graphicsPipelineConfig->assignDescriptor()
and instead manually create thevsg::BindDescriptorSet
but from what I can tell that's the way to go if you need a different uniform value pervsg::VertexIndexDraw
within the samevsg::StateGroup
.My next goal is to do the same thing with text. My plan is to create a new text shader based on the
text.vert
shader by adding theColorBlendUniform
the same way I did for handing triangles. However this seems a bit more complicated. In order to create the descriptor I need the pipeline layout which in my previous example I got from thevsg::GraphicsPipelineConfigurator
. In this case thevsg::GraphicsPipelineConfigurator
is created in the layout technique. So before I go down a rabbit hole I'm wondering if there is a better way to dynamically adjust the alpha of basic shapes and text?Beta Was this translation helpful? Give feedback.
All reactions