GithubHelp home page GithubHelp logo

acskyline / vld3d11 Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 171.1 MB

d3d11 volumetric light

C++ 84.82% HLSL 1.20% C 13.98%
directx11 volume-rendering ray-marching volumetric-lighting volumetric-fog godrays

vld3d11's Introduction

VLD3D11 (this project is still in progress)

  • Tested on: Windows 10, i7-7700K @ 4.20GHz 16.0GB, GTX 1080 15.96GB

  • Based on GPU Pro 5: Volumetric Light Effects in Killzone: Shadow Fall and NVDIA Volumetric Lighting Slides

  • Cooling fan model from Sketchfab

Current Result

Features


I. Basic Renderer Functions

overview

details

  • Render Texture

  • Orbit Camera

  • Gizmos

  • Texture Mapping

  • Basic Geometry


II. Volumetric Fog

overview

cube sphere cone
geometry movement light movement

details

When rendering the geometry, for each fragment of it, I calculate a ray from the camera to that fragment. Then I use the ray to intersect the geometry in the fragment shader and find the enter and exit position. Then I use ray marching along the vector from enter to exit. During this process, several positions along the ray will be evaluated. For each position, a scalar noise produced by a 3D noise function will be used as a scaling factor which will then be used as a scaling factor to scale the result of the scattering phase function to get the final scattering factor.


III. Volumetric Light (spot light) (with PCF shadow)

overview

cube sphere cone
camera movement light adjustment

details

To make sure the volume will be rendered when the camera is inside of it, the culling mode is set to cull front face. To make sure the volume will be rendered when a object is inside of it, the depth test is disabled (as well as depth write). To get the correct enter and exit position of the ray intersecting the volume, (so that ray marching accumalates the correct amount of energy) the screen space depth is used to clamp the exit position and the camera position is used to clamp the enter position.


IV. What's next?

  • Dither Pattern & Up Sampling

  • Full Screen Volume (Quad)

  • More Light Types

    • Directional Light

    • Point Light

  • More Shadow Techniques

    • Variance Shadow Map

    • Percentage Close Soft Shadow

  • Some Clouds Rendering Experiments?

vld3d11's People

Contributors

acskyline avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

asdlei99

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.