### chromaticLens postFx?

Materials, textures, lighting, postfx

#### chromaticLens postFx?

Duion
Posts: 966
Joined: Sun Feb 08, 2015 1:51 am

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.

#### Re: chromaticLens postFx?

Jason Campbell
Posts: 253
Joined: Fri Feb 13, 2015 2:51 am

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

$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;
};

{

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 );
}

#### Re: chromaticLens postFx?

Duion
Posts: 966
Joined: Sun Feb 08, 2015 1:51 am

How you made it work? And what is it good for? And why is it in the default template?

#### Re: chromaticLens postFx?

Jason Campbell
Posts: 253
Joined: Fri Feb 13, 2015 2:51 am

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?

#### Re: chromaticLens postFx?

JeffR
Steering Committee
Posts: 813
Joined: Tue Feb 03, 2015 9:49 pm

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.

#### Re: chromaticLens postFx?

Jason Campbell
Posts: 253
Joined: Fri Feb 13, 2015 2:51 am

Yeah, I didn't think about it much. It could be used to show a security camera feed also or a cut scene that is supposed to be in the past or something.

#### Re: chromaticLens postFx?

Steve_Yorkshire
Posts: 248
Joined: Tue Feb 03, 2015 10:30 pm

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.

#### Who is online

Users browsing this forum: No registered users and 2 guests