Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Creating a FXAA custom shader. Need help testing.

Years of Service
User Offline
Joined: 31st May 2013
Posted: 11th Jun 2013 15:29
Hi there. I've knocked together a custom fxaa shader based on open source code for a fxaa injector app. Normally this is used as an fxaa injector for directx 9 games but I've packaged it together as a .fx shader file with separate .h include files (as it is originally presented) and am trying to test if it can run in dbpro with limited success.

The problem I have is that I'm struggling really badly to successfully use any shader files in dbpro and that's down to me. I know very little about them. I only just discovered about multi layered texturing, light mapping etc and am still trying to figure it all out. Tbh my head hurts trying to keep up with this. Almost every time I try to use any type of shader, it never works as supposed to. Normally I would see for example textures vanishing and ctd's when trying to exit code or grossly distorted objects that look nothing like the shaders effects and that's just with shaders confirmed to be working with dbpro. I suck, I know lol.

The shader is included in this post. It has multiple functions/effects including fxaa anti aliasing, pre sharpen, hdr, bloom, tone mapping, Technicolor, sepia etc. I know dbpro successfully loads the .fx file, recognises effect 1 and tries to use it. I know that effect 1 is fxaa anti aliasing. I know fxaa isn't just nvidia specific. Its just a shader algorithm that anti aliases 3d and it works on ati gfx as well. When I try to use it on an object, it does anti alias it but the texture vanishes from the object, ie it becomes semi transparent. I also know that I've had the exact same problem using dbpro confirmed shaders so I believe this is down to me. I believe that the shader works and i'm just not using it correctly.

So, I throw it out there. Could someone in the know please test this shader for me and confirm at least if it does fully function? It would be an excellent shader to add to the collection if it does.

*crosses fingers and toes and hopes this will work

Oh fyi, the settings to adjust the shader are kept in a separate file in the injfxaa shaders folder. A file called "usersettings.h". Strength and adjusments can be made to it in there. You should only need to load the shader.fx file and specify the effect number you want to use as the rest of the files are "#includes".

And if it doesn't work, then i'm sorry to have wasted peoples time. Again but I don't know enough about this to tell for fact and also, while searching this form, I cant find any discussion about this shader.


Login to view attachments
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 12th Jun 2013 00:09
It seems the #include directive is not always enabled in HLSL when you compile them on the run (MSDN Page).

"Why do programmers get Halloween and Christmas mixed up?"
James H
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 13th Jun 2013 02:15
I suspect the include files must also be of the .fx extension(.vsh/.psh might work and maybe even whatever the extension for asm is, as those work in dbp aswell) - the .fx include works in dbpx10 for sure and I`m reasonably sure the sm3.0 example in darksource examples for dbpx9 is set up in similar fashion to show us how dbpx10 code works, I would double check if I could but don`t have the means to right now
I also would think any settings shouldn`t be an include but would have to be set using dbp code or set in the shader file itself
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 23rd Jul 2013 04:48
To use a "fullscreen shader" aka a post process you need to render your scene using

set camera to image

then applying that image to a plane and rendering just that plane to the screen. You would apply the FXAA effect to that plane. I would start by getting the post-process working with no fxaa (just a texturing-only shader) then add in the FXAA.

Login to post a reply

Server time is: 2020-01-20 17:46:03
Your offset time is: 2020-01-20 17:46:03