Saturday, 15 May 2010

Webgl coloring the entire geometry? -



Webgl coloring the entire geometry? -

i using triangles(using vertices , face position) draw graphics.i storing color info each vertex , applying colors accordingly. problem geometries in scene of single color(say cone=red, cylinder=blue). so, storing color each vertex apparently of no utilize me.

is other approach coloring can done in webgl apart storing color info of each vertices in scene. maybe coloring entire geometry(say cone).

if geometry has color per object, doesn't alter across geometry, should pass color uniform variable.

so en 1 attribute - position of vertices, few matrix uniforms - model, view, projection matrices, vertex shader, , 1 vector uniform variable fragment shader "shading" object.

webgl

No comments:

Post a Comment