Sponsored By

3D Game Development (AlwynD3DFramework): Framework vegetation custom font rendering and distance clipping with procedural House geometry example (PART II render and shader code)

This shows how to render vegetation using instanced, and auto clipping at a certain distance (Part II)

Game Developer, Staff

November 24, 2011

1 Min Read
Game Developer logo in a gray background | Game Developer

Framework vegetation custom font rendering and distance clipping with procedural House geometry example (PART II render and shader code)






The render function.

This is the main render loop, that gets called by the framework render each frame, screen has already been cleared with black, but I like to use blue for this demo, as this is not rendered in a skybox or sphere box, it really doesn’t matter that much, the rednerfunction here is responsible for:

1.       Get device input (will set the fwd, strafe side values )

2.       Set the raster state (based on keyboard input), for wire frame or normal render (normally I prefer this in HLSL, but for this demo I did it from CPU)

3.       Camera/View translation according to user input.

4.       Creating and setting the mvp combined matrix , and other matrices on the GPU via HLSL.

5.       Performing clip checks on all objects that are clip check enabled (radius > 0 and midPoint set, midpoint may be updated for each instanced clip mesh as /if it moved requires updating.)

6.       Rendering the geometry I just initialized

7.       Rendering the HUD/font characters to screen, to show various information, like FPS.

This example pictures

Code Sample: [TerrainHouseClip]

Part I

Read more about:

2011Blogs
Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like