Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

103 Neutral

About ccel

  • Rank

Personal Information

  • Interests
  1. ccel

    FrameBuffer / Multi light

    Ah sorry I misunderstood, I answered your question on stackexchange. https://stackoverflow.com/questions/53549406/how-to-add-countless-lights-in-framebuffer/53607753#53607753 The point about doing it in a single pass still stands since you have more control over the loops and you can have any number of lights still (especially if you use a https://www.khronos.org/opengl/wiki/Shader_Storage_Buffer_Object). The 512 suggestion was just a suggestion for a max limit... you can't really render an infinite number of lights per frame anyway, it won't be real time anymore XD
  2. It doesn't look like there's an API to do that on Unity, but you could have a cached version of the matrix array, modify a single element and call SetMatrixArray again. At the low level, most of the time you don't end up patching constant buffers anyway, you just send the whole thing again.
  3. Bloom is typically done by extracting the bright pixels of the scene, then doing a blur, then additively applying the blurred pixels back onto the frame buffer. The bright pixels can come from bright lighting or bright emissive values. What you determine to be "bright" or "bloomable" is up to you.
  4. In your algorithm each time you insert an image, you're always picking a horizontal split. This is why you are only able to fill the space to the right with increasingly smaller < h elements. Check out this post on using kdtree. The altered idea is to alter the direction of your split depending on which dimension is greater. http://blackpawn.com/texts/lightmaps/default.html EDIT: found this link from a forum post on here from 2005!
  5. ccel

    .PFM to LDR RGB (0-255,0-1.0)

    You probably need to consider Exposure & Tonemapping. i.e. what if the HDR image has values all greater than 10000? Also since this is a lossy operation, the choice of tonemapper will have impact on the LDR/SDR result. Geometric mean computed using the sum of log luminances is a common way of finding an exposure. Then applying a common tone-map operator like Reinhard, Hable's Filmic curve, or even one of the new standard ACES ODT transforms can be done. They all have different results. I would reference MJP's post on the topic. https://mynameismjp.wordpress.com/2010/04/30/a-closer-look-at-tone-mapping/
  6. You can treat volumetric lighting similar distance fog where you attenuate the light path from surfaces to camera. So this can be applied in your gbuffer pass after you light the pixel. See slide 45 from Bart Wronski's 2014 SIGGRAPH talk: https://bartwronski.files.wordpress.com/2014/08/bwronski_volumetric_fog_siggraph2014.pdf
  7. I'll mention that your blending capabilities are limited if you have to rely on the hardware's blend mode. This changes are if you are able to do it in a single draw call by iterating over a light list in your shader. This generally requires you to go to a tiled approach to reduce cost, but depending on your use case it might be fast enough just to loop through all the lights and reject them based off of bounds.
  8. ccel

    FrameBuffer / Multi light

    The tutorial can be tweaked to greatly increase the number of lights. Set NR_LIGHTS to some high value like 512, this is now your "maximum number" of lights on screen. Then pass in a uniform for the number of active lights, the shader will exit the for loop. There's no need to render geometry per light, that makes it more complicated. This does a single pass that loops over all of your lights per pixel.
  • 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!