Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

1006 Excellent

About LandonJerre

  • Rank

Personal Information

  • Role
  • Interests


  • Github

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. LandonJerre

    G-Buffer 2 Channel Normal

    In my home project, I just shoved the sign bit into another channel somewhere where i had space left. For a time I used the roughness channel for it, it was a full float channel, but roughness goes only from 0 to 1, so the sign portion was entirely unused. Nowadays I put it in one of the free 2 bit alpha channels in one of the g-buffers. Another solution is to use a different kind of encoding that handles this kind of stuff, but I don't have experience with those.
  2. LandonJerre

    Material and Shader Systems

    The trick is that you could create runtime those "structs" that are used to update a constrant buffer. If you think about it, the hard coded structs used for this are really simple things, aligned pieces a continous memory, where each field is in reality an offset to the beginning address of that piece of memory. Knowing this, and knowing how the constant buffer layout of the shader looks, plus the field names, you could do the whole thing runtime. Basically you allocate enough memory to hold the CB, then based on the order of the fields and their types, you could calculate the offset for each one, and store it in a list with their name. When you want to change a value in the buffer, you look up it's name, add the offset to the beginning address of the memory chunk, and then write the value into the buffer at that starting position. You then "upload" this buffer to the GPU CB, and thats about it. What you have to be careful about is the alignment requirements, and if you use a tool to generate your shaders and their CBs, then that has to create a CB layout that respects the packing rules for CBs.
  3. Do you use some kind of prefiltered mip chain to look up the color info during resolve, or just the backbuffer? ( The slides mention prefiltering to reduce noise, it should help with rougher surfaces, and places where the intersection is further away. ) Another thing that would be interesting to try out, is to slowly drop ray reuse in cases where the reflection is close to being mirror like. The idea is in these cases the original ray already contains all the info about the reflection that is needed, using the neighbouring pixels data wouldn't contribute to the result in any useful way. ( If we would be doing some kind of cone tracing to calculate reflections, in these cases the resulting cone would be "raylike", because the low roughnes would result in low cone angles, and the close by intersection would make the cone short. ) The idea is similar to reflection probe prefiltering, where the top mip level's prefiltering pass could be skipped, because it represents mirror like reflections. I don't know if this would work/help in this case, but in my mind it makes perfect sense. This github repo could help also: It's unity implementation of the technique, you could find result shots in the unity forum somewhere too. ( I'm planning to implement SSSR too, this repo is one of the sources I use to plan out my implementation. )
  4. LandonJerre

    C++ IDE for Linux

    Try this link. As far as I know the whole qt package is still free with an LGPL license, they just got exceptionally good at hiding it.
  5. LandonJerre

    PSO Management in practice

    This is kind of what I do too, although I still have separate blend/raster/depth state objects, you have to build a PSO out of them to use them in a draw command. In D3D11 they actually hold the native state objects, and the PSO basically just holds a reference to them, this would turn around in the planned D3D12 implementation, where the separate state objects would only contain the descriptors, and the PSO would have the native stuff. It's kind of a mix of both worlds.
  6. LandonJerre

    Tone Mapping

    RGBA16_FLOAT format for HDR should be more than enough. You should probably be running your post processing on non-multisampled textures. You should resolve or even downsample your g-buffers before post processing for faster access in the shaders. The output render targets should definetly be non multisampled for post processing. Small addition: if you use physically based sky/sun stuff, you could easily end up with values in your scene, that are bigger than what a half can store. In that case you either need to do some preexposition at the end of the lighting/sky passes (the frostbite pbr course notes mention how they do this), or use 32bit RTs. (I do the latter at the moment, preexposing would be the preferable way to solve this, but I haven't yet had the patience to rewire my frame graph to support it.)
  7. LandonJerre

    Exponential VSM problem

    It is an expected behaviour, with VSM (and any other related techniques) you have to render both the occluders and the receivers into the shadow map. If you think about it, when you blur the VSM without the receivers in it (or even if you just sample that map with proper texture filtering), you blur between the occluder depths, and the maximum z value, meaning that the blurred values will strongly tend towards the max z. Tending towards max z also means that the blurred values will be "behind" the receiver pretty quickly, and that messes up the whole thing. (This explanation is exactly mathematically precise, but hopefully it's enough to illustrate the problem.)
  8. LandonJerre

    Diffuse lighting for water shader

    I could be wrong, but from the images you linked it looks like you're using a single color for the entire sky. Before hacking the water lighting calculations, I would try to replace it with something more "interesting", like a proper texture of a clear sky. It should help at least somewhat, because if you use a homogenous sky, the direction of the reflection vector won't really matter, you will fetch the same color regardless. With a proper sky texture that won't be the case, because different parts of the sky are colored different kinds of blue.
  9. AFAIK the PS4 Pro has some special hardware extensions to make checkerboarding easier, but the R6 Siege version doesn't depend on any special capabilities. The slides say that the resolve pass adds about 1.4ms, but the whole stuff still saves around 8-10ms, which is kind of awesome. (Ever since I first saw the slides describing how they do this, I'm toying with the idea of implementing it in my hobby renderer, but the resolve shaders flow graph, and the fact that they admit their implementation was done by trial and error, scares the hell out of me.)
  10. LandonJerre


    The truth is somewhere inbetween the two. :) setInterval afaik doesn't care about how long the passed callback runs, and it won't fire exactly on given delays either. With the given example, the browser will queue up the passed callback for execution every 150ms, but it will only execute when the execution "thread" doesn't have anything else important to run. (This is why the age old setTimeout with zero delay hack works, a 0 as a delay in this case doesn't mean it will execute immediately, it just means that it will run as soon as possible when nothing else is running.) Sidenote: it is perfectly possible to do the second option you described with recursive setTimeouts, e.g: (function func(){     setTimeout(function(){         //code         func();     }, delay); })();
  11. Me too use RenderDoc ( for graphics debugging, it does everything you described and much more. Debugging really large shaders can bit a bit of a pain, but other than that I haven't had any significant problems with it.
  12. Try changing the line "i /= base" to something like "i = math.floor(i / base)". ( if you look at the pseudocode, it has the floor operation too. )
  13. LandonJerre

    Soft Particles Vanishing in the Distance

    If your depth buffer isn't linear, then the depth distance between things at a unit distance from eachother in the world, will become shorter as you get further away from the camera. ( the article isn't particularily about this, but the figures illustrate well what happens here. ) So effectively your particles get "closer" to other stuff, that would trigger the softening the furter away from the camera they are. The fastest fix in this case would be linearizing the two depths before you compare them.
  14. LandonJerre

    Resolution scale, good thing ?

    They create the render target on the fly if not one is available for the asked size using a render target pool ? Is it ok to downscale/upscale using the hardware filtering ? With dynamic scaling you have a minimum and a maximum resolution multiplier, so it's easier to just create a rendertarget that fits the size of the maximum scale, and then render with the viewport set to the actual scale used at the moment. I used this ( article as a reference to implement this kind of stuff in my framework, it discusses filtering options too.
  15. LandonJerre

    Resolution scale, good thing ?

    Well, from an end user perspective it's either never used, or it's a lifesaver. For example without a resolution scaling option, I would've had a hard time playing Mass Effect: Andromeda, to reach a framerate between 30-60FPS I needed to put everything to low and set the scale to x0.8. (My i7 920 + GTX670 rig isn't the beast it used to be :) ) If you think about it, back in the old days we set lower resolutions to get some extra needed perf, resolution scaling achieves about the same effect, but provides more fine control over the rendering resolution, and does this while still outputing a backbuffer in the native resolution of the screen. (Not to mention that no matter what the set scale value is, you can still render your ui at the native resolution, so it doesn't become a blurry unreadable mess.)
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!