Easy way to render colored wireframes?
I have some stuff that I''m rendering as line lists to generate wireframe renderings. I want to be able to color the wireframe, but I really don''t need the color to vary over the wireframe, so storing a diffuse color per-vertex seems like over-kill to me.
Is there an easy and efficient way to render these suckers all in one color without adding diffuse color to my FVF?
-John
you don''t need to render as linelists to render wire frame:
see SetRenderState(D3DRS_FILLMODE,FILLMODE_WIREFRAME) or something like that, i can''t remember exactly.
Basically theere''s a fill mode renderstate you can set to wireframe.
then you can just render geometry like normal (as tri lists or whatever you''re using)
if you wanted to change the colour you could perhaps use lighting and materials and apply a material of a particular colour to everything, which would save having to use the diffuse colour at each vertex.
HTH
Toby
Gobsmacked - by Toby Murray
see SetRenderState(D3DRS_FILLMODE,FILLMODE_WIREFRAME) or something like that, i can''t remember exactly.
Basically theere''s a fill mode renderstate you can set to wireframe.
then you can just render geometry like normal (as tri lists or whatever you''re using)
if you wanted to change the colour you could perhaps use lighting and materials and apply a material of a particular colour to everything, which would save having to use the diffuse colour at each vertex.
HTH
Toby
Gobsmacked - by Toby Murray
>>you don''t need to render as linelists to render wire frame: see SetRenderState(D3DRS_FILLMODE,FILLMODE_WIREFRAME) or something like that, i can''t remember exactly.<<
That''s cool. But actually, in this case, I just want to do it the line list way, since I''m not exactly doing a wireframe per triangle.
>>if you wanted to change the colour you could perhaps use lighting and materials and apply a material of a particular colour to everything, which would save having to use the diffuse colour at each vertex.<<
I could be wrong, but doesn''t using a material and lighting to color an object require a diffuse and/or normal anyway? Besides that though, rendering with lighting would be more intensive than I''d want to spend for wireframes...since I just want ''em a solid color.
Thanks for the ideas though!
-John
That''s cool. But actually, in this case, I just want to do it the line list way, since I''m not exactly doing a wireframe per triangle.
>>if you wanted to change the colour you could perhaps use lighting and materials and apply a material of a particular colour to everything, which would save having to use the diffuse colour at each vertex.<<
I could be wrong, but doesn''t using a material and lighting to color an object require a diffuse and/or normal anyway? Besides that though, rendering with lighting would be more intensive than I''d want to spend for wireframes...since I just want ''em a solid color.
Thanks for the ideas though!
-John
Or use a Vertex Shader using a colour as a constant?
Neil
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
Neil
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement