Jump to content

[SOLVED] mesh_wire_base material


photo

Recommended Posts

Specialized material for rendering of anti-aliased thin geometry like wires, antennas, street markings as described under http://www.humus.nam...?page=3D&ID=89.

 

I am sure that EVERY virtual world customer will love such a material (best-case including corresponding shadow map material !) as thin-line aliasing/shimmering both of the geometry itself and it's shadows is one of the most disturbing and uncontrollable artifacts e.g. in typical urban environments.

Link to comment
  • 2 weeks later...

Wow frustum, that was quick ! This vertex-shader solution seems to use a different approach than the (DX10+ only?) pixel-shader base one of HUMUS with blending. Is there any drawback ? And what is the magic behind

 

#ifdef WIRE
  float radius = max(getPosition(vertex).w * s_viewport.w / s_projection[1].y,0.0f);
  vertex.xyz += normal * radius;
 #endif

 

Does this ensure that mesh vertices stay always at least 1 pixel away after projection to screen space ?

Link to comment

HUMUS wire demo doesn't require DX10 hardware. This code can keep any geometry from zero-pixel collapsing. Blending option is not available because of depth-based post effects like scattering and depth of field. Alpha dithering fade is used instead.

Link to comment

I think <SDK>/data/core/scripts/system.h needs small modification for including the new material too

 

...
void init(string name_,string locale_) {
......
 // load materials
 if(simple_materials) {
.....
  engine.materials.load("core/materials/simple/unigine_mesh_wire.mat");

 } else {
...
  engine.materials.load("core/materials/default/unigine_mesh_wire.mat");
 }
....
}

Link to comment
×
×
  • Create New...