Changeset 785333b in opengl-game


Ignore:
Timestamp:
Dec 5, 2019, 4:08:17 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
2b40f48
Parents:
055750a
Message:

Setup debug environment for ship shader lighting

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • shaders/ship.frag

    r055750a r785333b  
    4343   vec3 Is = Ls * Ks * specular_factor;
    4444
    45    outColor = vec4(Is + Id + Ia, 1.0);
     45   //outColor = vec4(Is + Id + Ia, 1.0);
     46   outColor = vec4(color, 1.0);
    4647}
  • shaders/ship.vert

    r055750a r785333b  
    4242   light_position_eye = vec3(ubo.view * vec4(light_position_world, 1.0));
    4343
    44    gl_Position = ubo.proj * vec4(position_eye, 1.0);
     44   //gl_Position = ubo.proj * vec4(position_eye, 1.0);
     45   gl_Position = vec4(vertex_position, 1.0);
    4546}
  • vulkan-game.cpp

    r055750a r785333b  
    268268   // TODO: With the normals, indexing basically becomes pointless since no vertices will have exactly
    269269   // the same data. Add an option to make some pipelines not use indexing
     270   /*
    270271   shipPipeline.addObject(addVertexNormals<ShipVertex>({
    271272         //back
     
    495496         135, 136, 137,
    496497      }, commandPool, graphicsQueue);
     498   */
     499
     500   // z-range is 0 to 1, with +1 pointing into the screen
     501   shipPipeline.addObject(addVertexNormals<ShipVertex>({
     502         {{  0.5f,  -0.5f,   0.5f}, {0.0f, 0.6f, 0.0f}},
     503         {{ -0.5f,  -0.5f,   0.5f}, {0.0f, 0.6f, 0.0f}},
     504         {{ -0.5f,   0.5f,   0.5f}, {0.0f, 0.6f, 0.0f}},
     505         {{  0.5f,  -0.5f,   0.5f}, {0.0f, 0.6f, 0.0f}},
     506         {{ -0.5f,   0.5f,   0.5f}, {0.0f, 0.6f, 0.0f}},
     507         {{  0.5f,   0.5f,   0.5f}, {0.0f, 0.6f, 0.0f}},
     508
     509         {{  0.3f,  -0.3f,   0.3f}, {0.0f, 0.0f, 0.7f}},
     510         {{ -0.3f,  -0.3f,   0.3f}, {0.0f, 0.0f, 0.7f}},
     511         {{ -0.3f,   0.3f,   0.3f}, {0.0f, 0.0f, 0.7f}},
     512         {{  0.3f,  -0.3f,   0.3f}, {0.0f, 0.0f, 0.7f}},
     513         {{ -0.3f,   0.3f,   0.3f}, {0.0f, 0.0f, 0.7f}},
     514         {{  0.3f,   0.3f,   0.3f}, {0.0f, 0.0f, 0.7f}},
     515   }), {
     516         0,   1,   2,   3,   4,   5,
     517         6,   7,   8,   9,   10,   11,
     518   }, commandPool, graphicsQueue);
    497519
    498520   shipPipeline.createDescriptorSetLayout();
Note: See TracChangeset for help on using the changeset viewer.