Skip to content

Instantly share code, notes, and snippets.

@carmel4a
Created October 28, 2018 00:08
Show Gist options
  • Save carmel4a/be5d3c144f210f0e3f20bf5fddaa1f17 to your computer and use it in GitHub Desktop.
Save carmel4a/be5d3c144f210f0e3f20bf5fddaa1f17 to your computer and use it in GitHub Desktop.
gfx::geometrybank_handle geometry_bank;
geometry_bank = { GfxRenderer.Create_Bank() };
scene::shape_node shape;
shape.get_data().rangesquared_min = 0;
shape.get_data().rangesquared_max = 1000'000;
shape.get_data().material = GfxRenderer.Fetch_Material( "grass/grass04" );
shape.get_data().translucent = false;
auto shape1 = scene::shape_node( shape );
world_vertex v;
v.normal.x = 0.0f;
v.normal.y = 1.0f;
v.normal.z = 0.0f;
...
v.position.x = ...;
v.position.y = ...;
v.position.z = ...;
v.texture.s = 0.0f;
v.texture.t = 0.0f;
shape.get_data().vertices.emplace_back( v );
...
shape.origin( m_area.center );
shape.compute_radius();
m_shapes.push_back( shape );
m_shapes.back().create_geometry( geometry_bank );
...
// rendering
case rendermode::...:
{
for( auto& v_section : visible_sections )
for( auto& shape : v_section->shapes() )
Render( shape, false );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment