[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Public WebGL] WebGL rendering text and other basic objects



Hi, I am programming a tree-ring view for information visualization.
First, I have drawn many ring sectors. Each sector are formed by
triangles. They are drawn in 2D, with all vertices' Z coordinates
equal to constant value. Each sector has a uniform color, maybe
different from other sectors. All sectors are rendered in the same
unique canvas.
The vertex shader is:

vColor = aVertexColor;

Then, I want to render some text on each sector, which is the label of
the sector. I have learnt how to render text through the link:

http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=283502

but, I saw that it need to change the fragment shader to:

gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));

So, if I change to this shader, I may can not render the original
shader to a unique color, since text render need texture to assign
color.
Can I write two shaders, one for render the sectors, the other for
render the texts.
Do I need two canvas to do this? If so, does one canvas will hide the other one?

Thanks,
Yubao Wu

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------