diff options
author | chai <chaifix@163.com> | 2020-07-18 02:48:39 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-07-18 02:48:39 +0800 |
commit | e5e995103377f9bb79123ef8257d8680ed0945fc (patch) | |
tree | 1831f3d2242c8173075576816b9032001580d20b /src/example/03_texture/03_texture.c | |
parent | 275bf123ff505eef3333ba41385ed3814eb9a507 (diff) |
*late culling
Diffstat (limited to 'src/example/03_texture/03_texture.c')
-rw-r--r-- | src/example/03_texture/03_texture.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/example/03_texture/03_texture.c b/src/example/03_texture/03_texture.c index 5afb3de..09d8f97 100644 --- a/src/example/03_texture/03_texture.c +++ b/src/example/03_texture/03_texture.c @@ -46,11 +46,14 @@ static Mesh* ball_mesh; EXAMPLE void onload_texture(void* data) { CameraConfig* conf = (CameraConfig*)data; - mech_albedo = texture_loadfromfile("res/dieselpunk/mech_basecolor.tga"); + //mech_albedo = texture_loadfromfile("res/dieselpunk/mech_basecolor.tga"); + mech_albedo = texture_loadfromfile("res/gun/gun.png"); mech_normal = texture_loadfromfile("res/dieselpunk/mech_normal.tga"); mech_roughness = texture_loadfromfile("res/dieselpunk/mech_roughness.tga"); mech_metalness = texture_loadfromfile("res/dieselpunk/mech_metalness.tga"); - mech_mesh = mesh_loadfromobj("res/dieselpunk/mech.obj"); + //mech_mesh = mesh_loadfromobj("res/dieselpunk/mech.obj"); + mech_mesh = mesh_loadfromobj("res/gun/gun.obj"); + //mech_mesh = mesh_loadfromobj("res/gun/triangle.obj"); ground_albedo = texture_loadfromfile("res/dieselpunk/ground_basecolor.tga"); ground_mesh = mesh_loadfromobj("res/dieselpunk/ground.obj"); yingham_albedo = texture_loadfromfile("res/dieselpunk/yingham_basecolor.tga"); @@ -78,7 +81,7 @@ EXAMPLE void onupdate_texture(void*data) { } EXAMPLE void ondraw_texture(void*data) { - ssr_bindvertices(verts, 8, cube, 12); + //ssr_bindvertices(verts, 8, cube, 12); ssr_useprogram(&ssr_built_in_shader_pbr); ssr_enable(ENABLE_BACKFACECULL | ENABLE_DEPTHTEST | ENABLE_WRITEDEPTH | ENABLE_BLEND); @@ -106,14 +109,14 @@ EXAMPLE void ondraw_texture(void*data) { ssr_setstencilop(STENCILOP_KEEP, STENCILOP_KEEP, STENCILOP_KEEP); */ /*render yingham*/ - ssr_setuniformtex(0, yingham_albedo); - ssr_bindvertices(yingham_mesh->vertices, yingham_mesh->vert_count, yingham_mesh->triangles, yingham_mesh->tris_count); - ssr_draw(PRIMITIVE_TRIANGLE); + //ssr_setuniformtex(0, yingham_albedo); + //ssr_bindvertices(yingham_mesh->vertices, yingham_mesh->vert_count, yingham_mesh->triangles, yingham_mesh->tris_count); + //ssr_draw(PRIMITIVE_TRIANGLE); /*render ground*/ - ssr_setuniformtex(0, ground_albedo); - ssr_bindvertices(ground_mesh->vertices, ground_mesh->vert_count, ground_mesh->triangles, ground_mesh->tris_count); - ssr_draw(PRIMITIVE_TRIANGLE); + //ssr_setuniformtex(0, ground_albedo); + //ssr_bindvertices(ground_mesh->vertices, ground_mesh->vert_count, ground_mesh->triangles, ground_mesh->tris_count); + //ssr_draw(PRIMITIVE_TRIANGLE); //draw_tbn(mech_mesh, VISUAL_ALL, 4); |