Jump to content

FXShine shader


BarbaricCo

Recommended Posts

Think there could be no "one fits all shader" type, also considering individual monitor gamma, GFX cards settings, OS and hardware. Not to forget matters of individual taste. But it´s good to know how to achieve certain GFX effects generally, by changing few parameters that fit ones needs. I´d attempt on parameters that fit night, sunny or rainy weather, dusty or hazy environments ect. individually and load them before starting the actual battle. Would be nice if one could switch them (through cycling from ALT-M maybe) during game play which we see is possible (normal game, ML and artificially bright night) by default. From my current understanding, the shader files are something like precompiled during game start and kept in memory, so technically it would be doable to have more than 2 shader settings available during game play.

@CarlWAW and BarbaricCo

could you also please post individual parameter changes for each graphic example? That would help better understanding how this all works and how to adapt settings, when considering OS and hardware differences for each user! :)

To help other users, it would also be useful to know which text editors (Mac/PC) can be used that properly read and write the *.frag files! As said, I use this editor that I found working with the files for a long time:

http://www.armaholic.com/page.php?id=1455

Had that one to my avail for ArmA file editing anyway, but I´d assume the following (Notepad++) does the purpose as well, or better:

https://en.wikipedia.org/wiki/Notepad%2B%2B

Link to comment
Share on other sites

@RockinHarry

 

Honestly I see a problem with the fan-attitude of some posters here. They are shooting down good ideas all the time. I fear, if it was told prior, which values were changed and which ones are original, they would (maybe even subconsciously) prefer the unchanged ones. Psychology, you know. ;)

 

Therefore I think blind tests are best to receive unbiased feedback. Afterwards ofcourse we should discuss what the effects of the values are.

 

For shader testing I think that it was good, if we would have certain test-scenes, to make reproducible screenshot comparisons among the different shaders. Therefore I plan to upload the savefiles, of the screenshots when I am finished uploading the pics.

Link to comment
Share on other sites

CarlWAW, not to knock your efforts, but I find I prefer Barbaric's work in his latest post #43. Those look pretty damn amazing.
 
Barbaric - when you say

This involves editing of bump mapped shaders, but also in consequence means that normal CM look will also be affected and out of balance.

With editing only "War Movie" shader You affect only the "alt-M" special mode so you can easily switch back to defaults. Now it's impossible — unless You move shaders from "z" folder.

 

Does this mean that you are now changing the shaders in the normal view, or that some of the changes bleed over into normal view - if the latter, you may as well go the whole hog and do the work in the Normal view - since AA works there etc. ;)

Sure, it will have to be moved in and out of Z folder as needed, but still, looking good.

Edited by Baneman
Link to comment
Share on other sites

CarlWAW, not to knock your efforts, but I find I prefer Barbaric's work in his latest post #43. Those look pretty damn amazing.

 

 

Nothing to worry. :)

Surely they look great but sadly it's one thing to make it look stunning at first sight or to watch it for hours without strain on the eyes. I have a quite good IPS panel here on my notebook and I guess for me the contrast in combination with the colors probably would be too much strain on the eyes.

Link to comment
Share on other sites

Here´s my take on the shader file. Its effect lays somewhere in the middle of no ML and some the high contrast, desaturated examples. Basically gives somewhat more contrast than original and also providing a darker night setting (not considering ALT-B and moon phases). Good all around alternative.

https://www.dropbox.com/s/yit4wow8tc0dgel/blur_shader.frag?dl=0

Parameters in effect:

/*const*/ float AvgLumR = 0.5;

/*const*/ float AvgLumG = 0.5;

/*const*/ float AvgLumB = 0.5;

fxaa_color = overlay(fxaa_color, vec3(0.33));

fxaa_color = BrightnessSaturationContrast(fxaa_color, 1.0, 1.0, 1.1);

gl_FragColor *= 1.05;

For simple B/W effect, the following can be used:

fxaa_color = BrightnessSaturationContrast(fxaa_color, 1.0, 0.05, 1.1);

Link to comment
Share on other sites

This is actually growing on me... played a few turns and even tried it on CMBS.  The only issues I have are the colours are just a tad too well... colourful and the sky seems completely washed out with it on.  I turned it back to the normal shader and now it just seems pale and a bit wishy washy... arrrgghh... why did I ever bother having a look at this.   :)

 

Edit : I see BarbaricoCo has ironed out a few of the issues.

Edited by ShaneGreer
Link to comment
Share on other sites

 

Few updates

 

What brings to life terrain and flora is overlay setting in "War Movie" shader but it affects vehicles and uniforms to become too dark, or garish. So regarding all of the suggestions and obvious shortcomings of this edited "War Movie" shader I tried to take it further.

 
This involves editing of bump mapped shaders, but also in consequence means that normal CM look will also be affected and out of balance.
With editing only "War Movie" shader You affect only the "alt-M" special mode so you can easily switch back to defaults. Now it's impossible — unless You move shaders from "z" folder.
 
- Dark shadow/garish areas in vehicles and uniforms are more pleasing.
- edited haze/sky gradients and clouds textures so they are not "burned".
- messing with shadows has performance impact.
- still didn't managed to tweak the fog.
 
Important is that Combat Mission still manage to retain a distinctive look. All of this was already "under the hood". I just tweaked the settings.
- It would be great if community up vote this, to came on priority list for next update (if it's possible; engine v4.0?) so players can enable/disable, something like "advanced shaders" option.
- to leave Battlefront to finalize this job. They know best what's more in the pipeline and how to make this official without breaking anything (at least for PC/Mac's with decent graphic card).
- Of course we can continue to play with the settings (please upload those screenshoots!) so they can make better decisions and see what works, what doesn't in different conditions. 
- and finally I must resume social and work life back to normal :)
 
What I also achieved while messing with shaders is to hard crash iMac. Need to check everything carefully before uploading this mode so it not became
Combat Mission - A Shader Too Far
 
Cheers!
 
 

 

 

When can we see this file for download.  :)

Link to comment
Share on other sites

I think I found my personal favourite settings.

 

aAWO5Rf.png

I think the tank's bright side and the parts in the shadows contrast perfectly with the green of the trees and the trees against the hazy sky, while the building's grey roof just has the correct brightness to shine through the trees. The feeling of depth is very good. OVerall the picture is pleasantly warm.


QGFPXjS.png

Soldiers in the shadows are black, while the contrast with the white church is not hurting the eyes. Wall in the shadow shows a good amount of darkness.

The different greens are good to feel, whithout the green color dominating the screen.

 

1u71H2g.png

Here I like the differences between being exposed to the sun, partial shadows and being fully in shadow. The green is vibrant enough to shine through the treetrunks, without dominating the screen. The green grass seems bright enough to clearly contrast any (moving) object on it.

 

gCZXXKi.png

Objects on the hill seem three-dimensional and nicely contrasting, without aggressive contrast from the sky. I like the blending of the sky with the rapeseed and the contrasting of the trees. Also the shadow of the tree in the foreground looks great.

 

And last but not least the previously used test scenes:

mTIVQek.png

Amazing how threedimensional and warm CM can look, like an excellent oil painting.

jDxHvMR.png

The rapeseed is yellow enough and contrasting well with the green, the trees are beautifully dark green, throw dark shadows, with just enough to guesstimate details of the vehicle; the green of the grass shows partial dryness, the wheat looks dry and the soil behind the rear StuG looks freshly plowed and fertile and the sky's contrast and clouds look natural.

krin9S2.png

 

 

Edited by CarlWAW
missing pic
Link to comment
Share on other sites

Here´s my take on the shader file. Its effect lays somewhere in the middle of no ML and some the high contrast, desaturated examples. Basically gives somewhat more contrast than original and also providing a darker night setting (not considering ALT-B and moon phases). Good all around alternative.



https://www.dropbox.com/s/yit4wow8tc0dgel/blur_shader.frag?dl=0

Parameters in effect:



/*const*/ float AvgLumR = 0.5;


/*const*/ float AvgLumG = 0.5;


/*const*/ float AvgLumB = 0.5;



fxaa_color = overlay(fxaa_color, vec3(0.33));



fxaa_color = BrightnessSaturationContrast(fxaa_color, 1.0, 1.0, 1.1);



gl_FragColor *= 1.05;





For simple B/W effect, the following can be used:



fxaa_color = BrightnessSaturationContrast(fxaa_color, 1.0, 0.05, 1.1);

That's it!

incredible how best things in life are really simple.

Please post the screenshots and shader

Link to comment
Share on other sites

That's it!

incredible how best things in life are really simple.

Please post the screenshots and shader

I´ll prepare some screenies later and post them in your CMBN thread! :)

From my understanding, the ML effects shader is layered on everything else, if switched on. Thus it has some bad effects on anti aliasing (AA), when certain parameters are tweaked beyond a healthy range which appears rather narrow. When switching ML on and off, one also notices a slight 1-2 pixel wide screen offset shift, which might be the cause that AA is almost  removed and jaggy edges reappear. I also wonder how the associated *.vert files interact with their *.frag files.:huh:

I just started to dig somewhat into GLSL (OpenGL Shader Language), to get a better understanding, although that likely keeps preserved to those people who already have a good understanding of OpenGL and C programming language. :P

https://en.wikipedia.org/wiki/OpenGL_Shading_Language

http://www.lighthouse3d.com/tutorials/glsl-tutorial/

Link to comment
Share on other sites

From my understanding, the ML effects shader is layered on everything else, if switched on. Thus it has some bad effects on anti aliasing (AA), when certain parameters are tweaked beyond a healthy range which appears rather narrow.

I also noticed that AA seems not to be deactivated in general. AA seems to be affected only where the shaders, which are used for ML, are present (vehicles, buildings).

 

I have never touched shader programming, but the language is surprisingly similar to Java/C++. I can hardly believe that GFX-cards can handle such amounts of less than optimal high level language code. Incredible. I thought graphics code was highly optimized and close to ASM programming. The good thing is, that in the meanwhile I think I have a rough understanding what the code in blur_shader.frag does (or is supposed to do).

 

 

 

 

 

Link to comment
Share on other sites

Here it is
FXShine blur + bumpmapping shaders 02a download link:

http://www.barbaricco.com/upload/CMRT_FXShine_02a_shader_download/

- this version also affect default mode

- if You have problems just delete those files from "z" folder

Please post Your results (ATI/ Nvidia/ Intel / graphic card memory - shaders ON/OFF and screenshoots).

 

@RockinHarry@CarlWAW here is little analysis what's going on:

http://www.barbaricco.com/upload/CMRTAnalysis/

antialiasing affects my performance too much but it seems in Opt-M mode that is worse because off contrast. Also performances are much more influenced by screen resolutions and number of vehicles/ infantry/ trees on map than on the shaders settings. My graphic card (ATI 6750m 512Mb) can't handle large resolutions and shaders well (no depth on far terrain with shaders on?). For editing bumpmap settings to make it simple it's just "shadowValue0 /=" in 4 places. (screenshoots are resampled to 1200px and saved as jpg for upload reasons).

 

blur-plus-bumpmapping-AllOn_the-Beauty.j

FXShine blur + bumpmapping shaders ALL BEST AND ON

 

blur-plus-bumpmapping-AllOn_the-Beauty2.

FXShine blur + bumpmapping shaders ALL BEST AND ON

 

blur-CarlWAW_plus-bumpmapping-AllOn_the-

CarlWAW blur settings + bumpmapping shaders ALL BEST AND ON

Now to some tactics analysis. Let's rock!

 

Link to comment
Share on other sites

I´ll prepare some screenies later and post them in your CMBN thread! :)

From my understanding, the ML effects shader is layered on everything else, if switched on. Thus it has some bad effects on anti aliasing (AA), when certain parameters are tweaked beyond a healthy range which appears rather narrow. When switching ML on and off, one also notices a slight 1-2 pixel wide screen offset shift, which might be the cause that AA is almost  removed and jaggy edges reappear. I also wonder how the associated *.vert files interact with their *.frag files.:huh:

I just started to dig somewhat into GLSL (OpenGL Shader Language), to get a better understanding, although that likely keeps preserved to those people who already have a good understanding of OpenGL and C programming language. :P

https://en.wikipedia.org/wiki/OpenGL_Shading_Language

http://www.lighthouse3d.com/tutorials/glsl-tutorial/

".vert Vertex Shader is a shader program to modify the geometry of the scene. It is executed for each vertex in the scene, and outputs are the coordinates of the projection, color, textures and other data passed to the fragment shader. 
.frag Fragment Shader is a shader program to modify image properties in the render window. It is executed for each pixel and the output is the color info of the pixel. "


Advanced stuff but if We somehow translate CM playing hours into learning shaders only sky is the limit:)

@BarbaricCo

Where do you have the *.frag file from? Is it a file in the BRZ-archives?

Have the comments been added by you, or are they original?

Yes. Search "RezExplode". Comments are original. Sometimes it's just trial and errors. I only commented Red Thunder default "BrightnessSaturationContrast" .

Do I understand you correctly? You are able to transfer my settings from the ML zBlurShader into the permanent graphics? :o

Bump mapped shaders are activated when You have "shaders ON". ML (Alt-M) blur shader is activated on top of the everything. I can't have controls over that.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...