Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: "post glow screenSize" and "post glow fixedSize"  (Read 265 times)
xtormlab
Community Member
*
Posts: 2


« on: June 21, 2008, 09:24:15 AM »

hi

i'm new in HLSL

i've tried 2 shaders from nvidia shader library : "post glow screenSize"  AND  "post glow fixedSize"

( http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html )

they are quite similar

the "post glow fixedSize" works just fine, i can easily make it available

but the same code won't fit the other one.  I can never get the "post glow screenSize" to work, this effect just didn't appear at all

which confused me all these days

does anybody have any idea?
Logged
ZaPPZion
Community Member
*
Posts: 297


« Reply #1 on: June 21, 2008, 09:31:57 AM »

Can you post your debugfile? Is everything loading like it should, and are there no other errors?

I'll try it myself as well, hang on, i'll be posting here in about 30 minutes i hope.

Greetings,
ZaPP
Logged
ZaPPZion
Community Member
*
Posts: 297


« Reply #2 on: June 21, 2008, 10:20:22 AM »

OK, i tried it.

The screensize one works, but you'll have to set the technique you want to use. I'll give you an example code of how i'm doing it right now. It's a bit sloppy, i put it into a quick template of mine, so i'm declaring the rendersurface and shader just before the loop. It's good though, since it'll be easier to read for you. I didn't make any changes to the HLSL shader found on the nvidia page, i just copied it straight. Also make sure you've got the include folder in your application folder. The include folder is found in the *.zip file from the nVidia shader. Hope you'll enjoy it Wink

Code:
public void Main_Loop()
        {
            TVRenderSurface RS = Scene.CreateRenderSurface(TV.GetViewport().GetWidth(), TV.GetViewport().GetHeight(), true, CONST_TV_RENDERSURFACEFORMAT.TV_TEXTUREFORMAT_A8R8G8B8);
            TVShader GlowShader = Scene.CreateShader();
           
            GlowShader.CreateFromEffectFile(Application.StartupPath + "\\Shaders\\abc.fx");
            GlowShader.SetEffectParamFloat("GlowSpan", 2.0f);
            GlowShader.SetEffectParamFloat("Glowness", 2.0f);
            GlowShader.SetEffectParamFloat("Sceneness", 6.5f);
            GlowShader.SetTechnique("Glow_9Tap");
           
            RS.SetNewCamera(Scene.GetCamera());
            //TV.SetAntialiasing(true, CONST_TV_MULTISAMPLE_TYPE.TV_MULTISAMPLE_4_SAMPLES);
            while (blnLoop)
            {
                CheckInput();

                RS.StartRender();
                Scene.RenderAll(true);
                RS.EndRender();

                TV.Clear();
                Screen2D.Action_Begin2D();
                Screen2D.Draw_FullscreenQuadWithShader(GlowShader, 0, 0, 1, 1,RS.GetTexture());
                Screen2D.Action_End2D();
                TV.RenderToScreen();
                Application.DoEvents();
            }
        }

Greetings,
Bart

PS. Not the 30 minutes i hoped for, but i couldn't fix it myself at first either.
« Last Edit: June 21, 2008, 10:23:05 AM by ZaPPZion » Logged
xtormlab
Community Member
*
Posts: 2


« Reply #3 on: June 23, 2008, 03:25:43 AM »

perfect

that's it

thanks~~ Grin
Logged
ZaPPZion
Community Member
*
Posts: 297


« Reply #4 on: June 23, 2008, 03:47:50 AM »

No problem, glad i could help out Tongue
It was a good training for me as well Smiley
I'm still experimenting with shaders, still in the learning progress, so i thought i'd best give it a try Smiley Found the mistake by accident. I suddenly saw there were 2 techniques, so i wondered if it needed to be set... It did:P
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks