Duion Posted January 14, 2017 Share Posted January 14, 2017 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. Quote Link to comment Share on other sites More sharing options...
Jason Campbell Posted January 21, 2017 Share Posted January 21, 2017 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 ); } Quote Link to comment Share on other sites More sharing options...
Duion Posted January 21, 2017 Author Share Posted January 21, 2017 How you made it work? And what is it good for? And why is it in the default template? Quote Link to comment Share on other sites More sharing options...
Jason Campbell Posted January 22, 2017 Share Posted January 22, 2017 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? Quote Link to comment Share on other sites More sharing options...
JeffR Posted January 23, 2017 Share Posted January 23, 2017 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. Quote Link to comment Share on other sites More sharing options...
Jason Campbell Posted January 24, 2017 Share Posted January 24, 2017 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. Quote Link to comment Share on other sites More sharing options...
Steve_Yorkshire Posted January 24, 2017 Share Posted January 24, 2017 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.