diff --git a/README.md b/README.md index 12c075f..bd1e837 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ # Pléascach +Small Vulkan 3D renderer. +![really cool wireframe tessellated terrain)](capture.png "Terrain Capture") +## Features +- glTF Model loading +- Tessellation-controlled heightmap terrains with dynamic normal calculation +- Working lighting! + ## Short Term Changes - Make index buffer device-local instead of host-coherent - Possibly restructure Buffer class to use templates to change diff --git a/Renderer/Pipeline.cpp b/Renderer/Pipeline.cpp index 33e7455..24745ce 100644 --- a/Renderer/Pipeline.cpp +++ b/Renderer/Pipeline.cpp @@ -93,7 +93,7 @@ GraphicsPipeline::GraphicsPipeline(vk::Device dev, const std::vector& sh const auto raster_info = vk::PipelineRasterizationStateCreateInfo { .depthClampEnable = vk::False, - .polygonMode = type == Type::eGLTF? vk::PolygonMode::eFill : vk::PolygonMode::eFill, + .polygonMode = type == Type::eGLTF? vk::PolygonMode::eFill : vk::PolygonMode::eLine, .cullMode = vk::CullModeFlagBits::eNone, .frontFace = Type::eGLTF ? vk::FrontFace::eClockwise : vk::FrontFace::eCounterClockwise, .depthBiasEnable = vk::False, diff --git a/assets/shaders/terrain.frag b/assets/shaders/terrain.frag index 105a75d..c6b5e77 100644 --- a/assets/shaders/terrain.frag +++ b/assets/shaders/terrain.frag @@ -23,7 +23,7 @@ void main() { /* extract L (light direction) from view matrix */ vec3 L = -cam_dir; float r = length(cam_pos-pos); - float t = clamp(dot(L, norm), 0.0, 1.0) * 20.0/(r*r); + float t = clamp(dot(L, norm), 0.0, 1.0) * 200.0/(r*r); - FragColor = vec4(t*norm, 1.0); + FragColor = vec4(vec3(t), 1.0); } \ No newline at end of file diff --git a/assets/shaders/terrain.frag.spv b/assets/shaders/terrain.frag.spv index 86a0808..784a409 100644 Binary files a/assets/shaders/terrain.frag.spv and b/assets/shaders/terrain.frag.spv differ diff --git a/capture.png b/capture.png new file mode 100644 index 0000000..a078dc4 Binary files /dev/null and b/capture.png differ