Fog/ mist shader?
- KTR2212
- Topic Author
Please Log in or Create an account to join the conversation.
- NattyDread
I just came here to request this also.
Please Log in or Create an account to join the conversation.
- crosire
For that you need a depthbuffer (which is there) and you need information about where the camera currently resides inside the game (translation, rotation, etc.) and the projection parameters (mostly field of view) or better the world/view/projection matrices. Those information cannot be obtained on a generic level, it's engine and game specific.
Now some (like field of view) could be just hardcoded in the shader, so that for each game one tries to find those values and sets them. Some are dynamic however (the camera position) and I can't think of a way to obtain these. One could try to simulate them by using keyboard and mouse input information to calculate an own position, but that would be highly inaccurate.
If somebody has a different idea, please share!
Please Log in or Create an account to join the conversation.
- NattyDread
You don't need camera position for DoF right? To my uneducated mind this looks so much like the DoF shader.
I would be happy with: fog color (near / far color as a plus); start distance (can go to negative values); end distance; opacity and that's it.
Please Log in or Create an account to join the conversation.
- crosire
Please Log in or Create an account to join the conversation.
- Kleio420
Could there not be some type of function down the road that could look for these values while the game is running to be dumped to be placed correctly instead of trying to guestimate the values ?crosire wrote: While volumetric fog, atmospheric scattering and all that can certainly be done as a post-processing effect (you can basicly raytrace everything, could even add new objects to the game) it requires to reconstruct the original positions for the objects in the scene.
For that you need a depthbuffer (which is there) and you need information about where the camera currently resides inside the game (translation, rotation, etc.) and the projection parameters (mostly field of view) or better the world/view/projection matrices. Those information cannot be obtained on a generic level, it's engine and game specific.
Now some (like field of view) could be just hardcoded in the shader, so that for each game one tries to find those values and sets them. Some are dynamic however (the camera position) and I can't think of a way to obtain these. One could try to simulate them by using keyboard and mouse input information to calculate an own position, but that would be highly inaccurate.
If somebody has a different idea, please share!
Please Log in or Create an account to join the conversation.
- Nerd
Please Log in or Create an account to join the conversation.
- NattyDread
Any chance on adding a defined axis fade (besides camera distance fade) so we can have something like height fog?
Please Log in or Create an account to join the conversation.