DOF, Refraction, Particles, Compromises.

Started by
13 comments, last by BEM 15 years, 2 months ago
Hi dmonte,

Yeah you can output a depth value to a texture even if you are not writing to a depth buffer, but this does not solve the problem I was describing.

Also in the solution you are describing, if you have DOF for your window you will not have DOF for the scene you are watching through the window. This would be more obvious if your window was not darkly tinted. Im not so worried about that one though because I can see possible solutions.
Advertisement
oh hmm, sort I guess and mix the depths. No other go no?

Or better yet, just design level such that funny situations like this never arise.

I guess it would make sense to just tint the glass, and make it refractive and then apply its DOF itself. I think all games do that right now.
but if you apply DOF after..
do you use the windows depth? (but then things you see through it that should be blurred arent)

or do u use the scenery's depth? (but if a long distance the window itself is blurred out as if it was far away)
What worries me most about DOF is the hard boundaries I expect when you blend transparent effects in. If your scene is full of volumetric effects they could be everywhere. One way I think you could solve this is to

(a) generate your DOFed opaques first, without considering transparancy.

(b) generate a 'DOFed depth map' also. This is your opaques' depth values blurred by the same function that you used in (a). However you also have to store another value to represent the fuzzyness of your DOF'ed depth values.

(c) Then render your non-opaques: Use soft particle techniques but also use the DOFed Depth map and factor in your fuzzyness value. (you cant even clip to the depth buffer!)

(Variance shadowmaps might be a clue how to generate and use this 'fuzzy depth'. maybe there is something simpler though.)

It just seems like too much complexity for a problem no one seems to have made a big deal over. :)
btw, was going to suggest a mipmap trick i thought up but apparently it has already been done:

http://www.gamedev.net/community/forums/topic.asp?topic_id=365001

Suppose your transparent objects are 2d planes, eg particles. I figure what you do is expand your billboard but shrink your UVs so the particle looks the same size on screen, then look up a mipmap level to create the correct blur radius. I guess you set your sampling to use a 0,0,0,0 border colour. Havent tried it though.

This topic is closed to new replies.

Advertisement