I see, that makes sense. So in order to implement actual real DoF, you'd need access to the engine?
Could you take a look at this:
http://forum.modsour...ttach=925;imagehttp://forum.modsour...ttach=929;imageThose are two screenshots from a guy who modded a newer version of the game about a year or two ago. He never said how he did it, the only thing he mentioned was how he modified some .psh/.vsh files. What he did say about it though, was that some users crashed while using it.
I'm almost certain he put a blur effect on the fog the game uses to 'mask' the render distance, but I still haven't found the right shader for it, here is how it looks normally, at minimum render distance, 50% and 100%. I know it's not real DoF, but it's an interesting effect and I'd really like to replicate it, perhaps enhance it down the road.
http://img528.images...eenshot0447.jpghttp://img526.images...eenshot0448.jpghttp://img194.images...eenshot0449.jpgI also found the following pdf, it's from the GDC way back which talks about SWG and how it uses shaders and does the rendering, in case it gives any usable info.
http://developer.amd...l06_jgrills.pdfAnother thing if you don't mind, I talked to a guy who said it might be possible to add better shadows to the game with "dx10 you have a slope dependent texture sample function". Again, I'm pretty inexperienced at the moment with this stuff, but do you think it's possible? The current shadow shader (I believe) is shadowvolume:
vsh:
//asm
TARGET
#include "vertex_program/modules/registers.inc"
dcl_position0 vPosition
m4x4 oPos, vPosition, cObjectWorldCameraProjectionMatrix
psh:
ps.1.0
def c0, 0.0, 0.0, 0.0, 1.0
mov r0, c0
Thank you for taking the time to reply though, you've been really helpful to get me to wrap my head around the subject. I'm looking into loads of resources about HLSL atm to understand it more in depth, but there is nothing like direct answers to questions.
EDIT:
I FINALLY found the fog hiding in the vertex shader function.inc.
Here is the code:
float calculateFog(float4 vertexPosition_o)
{
float4 position_w = mul(vertexPosition_o, objectWorldMatrix);
float3 viewer_w = cameraPosition_w - position_w;
float viewerDistanceSquared = lengthSquared(viewer_w);
return 1.0 / exp(viewerDistanceSquared * fog.w);
}I know what it does, I already have toyed around with it, is it possible to add a blur effect to it? For instance like the one in the OP? Or could you use calculateFog in the blur file?
I've checked all the shader files (Used a shader that has certain distinctions, like being pink) and slapped other shader names on it to visualize which file does what, just so I can personally see, because I still suck at HLSL, but none of them has anything to do with the fog.
Edit2: I just talked to someone, he said it's not possible to use the .psh for editing the look of the fog (blur in this case), because none of the .psh files use it. He doesn't know how they do the fog, since it's only in the functions.inc in the .vsh folder.
This is driving me nuts!
Edited by Timbab, 18 June 2012 - 03:32 PM.