Jump to content

chromaticLens postFx?


Duion

Recommended Posts

I noticed there is a chromaticLens PostFx shader in the folder, but it is not active or implemented into the system, so I tried to enable it, just to find that I cannot see anything.

Does anyone know how to enable it and what values are supposed to be used for the variables? Since I tried several values up to extreme numbers and still could not see any difference.

Link to comment
Share on other sites

It seems to do something. Adds the effect to everything.


Image link: http://imgur.com/89Kw7IN



 

$CAPostFx::enabled = true;
 
/// The lens distortion coefficient.
$CAPostFx::distCoeffecient =  -0.05;
 
/// The cubic distortion value.
$CAPostFx::cubeDistortionFactor =  -0.1;
 
/// The amount and direction of the maxium shift for
/// the red, green, and blue channels.
$CAPostFx::colorDistortionFactor = "0.005 -0.005 0.01";
 
 
singleton GFXStateBlockData( PFX_DefaultChromaticLensStateBlock )
{
   zDefined = true;
   zEnable = true;
   zWriteEnable = false;
   samplersDefined = true;
   samplerStates[0] = SamplerClampPoint;
};
 
singleton ShaderData( PFX_ChromaticLensShader )
{
   DXVertexShaderFile 	= "shaders/common/postFx/postFxV.hlsl";
   DXPixelShaderFile 	= "shaders/common/postFx/chromaticLens.hlsl";
 
   OGLVertexShaderFile  = "shaders/common/postFx/gl/postFxV.glsl";
   OGLPixelShaderFile   = "shaders/common/postFx/gl/chromaticLens.glsl";
 
   samplerNames[0] = "$backBuffer";
 
   pixVersion = 3.0;
};
 
singleton PostEffect( ChromaticLensPostFX )
{
   renderTime = "PFXAfterDiffuse";
   renderPriority = 0.2;
   isEnabled = true;
   allowReflectPass = true;
 
   shader = PFX_ChromaticLensShader;
   stateBlock = PFX_DefaultChromaticLensStateBlock;
   texture[0] = "$backBuffer";
   target = "$backBuffer";
};
 
function ChromaticLensPostFX::setShaderConsts( %this )
{
   %this.setShaderConst( "$distCoeff", $CAPostFx::distCoeffecient );
   %this.setShaderConst( "$cubeDistort", $CAPostFx::cubeDistortionFactor );
   %this.setShaderConst( "$colorDistort", $CAPostFx::colorDistortionFactor );
}
Link to comment
Share on other sites

That code is from chromaticFX.cs in core/scripts/client/postFX I think. I just changed some falses to trues. Just paste that over yours. However the real question is, what use is this? I admit it hurts to look at and apparently it just recreates an artifact created in a camera lens. Your guess is as good as mine. Maybe created back at GG?

Link to comment
Share on other sites

It's an increasingly common graphical effect used to make scenes feel more 'real' in terms of how accurate an image looks to how it'd look as taken by a camera. It's also occasionally utilized in conjunction with taking damage or the like to help convey it being bad.


But yes, the effect on it's own if used too much looks bad, and IS replicating a camera artifact, it still can be useful in achieving a certain look one may be going for.

Link to comment
Share on other sites

And what is it good for?

Invoking satan and his many little wizards ... Chromotic Abberation is literally the devil ...

I think it's from the big library of postFX shaders which is still available via the download in the resource on GG.


EDIT: If you're gonna use any of those you might want to swap the renderBin = "glowBin" to "ObjTranslucentBin". Just sayin'.


EDIT2: actually you probably want to swap renderTime= "PFXAfterBin" to renderTime = "PFXAfterDiffuse" or particles and transparent objects won't get affected by them. Anyhow, it's still a useful resource.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...