Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

607 Good

About stalef

  • Rank
  1. stalef

    Clipping on a wavy surface

    If you can sample the water height in the reflection pass fragment shader (easy if you are using a heightmap for the surface) you can discard the fragment if it is below water.
  2. stalef

    Cascaded Shadow Maps Look Bad

    What about the range of your cascades? You write you are using {0.001,10},{0.001,50} and {0.001,100}. They all start at 0.001. You should have some overlap, but currently they all start at the same distance. This is not needed, and you will also get z-buffer precission problems / z-fighting.
  3. stalef

    Ocean Wave 'Fake' SSS

    This is done in the NVidia Island demo. The demo/sample is in the DirectX11 SDK. Shader code is available. Might be more info in shader comments or whitepaper.   YouTube video:
  4. stalef

    Jittering near a landscape.

    Floats have better precision on small values. One solution is to divide your terrain into tiles, and center vertices for each tile to 0. Each tile have their own coordinate frame and will require separate model matrices. When the camera is close to a tile, the vertices in camera space will have small values and precision should be acceptable. At greater camera distance the precision will get worse, but less noticeable. The trick then is to do all matrix calculations with doubles, and only convert to single precision in the end. Do not send model and view matrices as two separate matrices to the shader and multiply in the shader. Calculate model-view matrix using double precision on the CPU, then upload final matrix to shader as single precision.
  5. Instead of using vertex colors, a fragment shader can easily calculate azimuth/zenith angle of each pixel, and based on those angles you could use math or texture sampling to get the color you want.   By doing this stuff in the fragment shader, the acutal geometry of the skydome/box in not very important as long as the geometry you do use will cover the parts of the screen the sky is covering.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!