Quote:Original post by AndyTX
Cool, I really like the RGBA8i mode... it gets better results than the RG16f one! Do you know how well it scales to larger depth ranges by any chance? I'm also interested in whether you can use a similar encoding with RGBA16i or whether you have any thoughts about better encodings for RGBA16f (as those two filter on previous generation AMD and NVIDIA hardware respectively).
Any chance we can see some code for the encodings too (once you have everything finalized of course)? I think I know what you're doing but it would be clearly to see it of course.
Cheers!
Andrew
Thanks! The RGBA packing mode basically should get the same resolution as 16i modes. That is a great idea to extend the packing to 16f and 16i formats, especially as it turns out that the RGBA8-packed mode still looks bad on older (pre-8xxx) hardware. I'm pretty sure that the artifacts come from my use of glGenerateMipmapEXT to generate the original mipmaps (as everything else, blur included, do the manual un/packing). Is there a way to quickly generate mipmaps, preferably _while_ blurring, using shaders and an FBO?
The packing for 16i will be straight-forward, obviously simulating a 32i format, so the ranges will still need to be scaled from [0..1]. It will not actually be as accurate as 32i, because all the packing instructions will be performed at 32f precision, but it should still be an improvement over the regular 16i format. I'm not sure what the scaling would be for 16f formats (most likely should be light_radius dependent). Since 16f formats already perform worse than 16i, I'm sure packing could improve the 16f quality at a minimum performance hit.
BTW, the code is all included in the zip (look in the main.cpp file, under init_XXXX_shader(). When I get this all polished I'll try to write up a little whitepaper on these little "Tips & Tricks", and I would love to have your feedback at that time [8^)
@ Neutrinohunter: I'm sorry it still isn't working on your machine...I don't have the hardware to test it. Regarding the FBO failing message, that only means that an FBO initialization failed for a specific format...I'll try to make the log less cryptic. I try to attach the texture, then do the standard glCheckFramebufferStatusEXT, and if that fails I emit that "FBO failed to initialize" message and cycle on to the next texture format.