XNA Game Development Forums
2012/05/21 21:22:35 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Calendar Login Register  
Pages: [1] 2 3 4
  Print  
Author Topic: Tutorial 8 :: Post Processing Framework  (Read 18081 times)
Chr0n1x
Global Moderator
Sr. Member
*****
Offline Offline

Posts: 307


View Profile WWW
« on: 2006/12/02 04:11:07 »

I have finished and uploaded my Post-Processing tutorial to my website, this is for the HMEngine.

Link to item: http://chronos.x10hosting.com
PDF and Source code in ZIP format avaliable from there.

Enjoy!

Post feedback either in comments there or post them here, I check both.
« Last Edit: 2007/02/22 01:49:33 by Chr0n1x » Logged

chavo_one
Newbie
*
Offline Offline

Posts: 1


View Profile
« Reply #1 on: 2006/12/02 13:53:42 »

When I click on that link I get:

Quote
Not Found

Sorry, no posts matched your criteria.

Sad
Logged
Chr0n1x
Global Moderator
Sr. Member
*****
Offline Offline

Posts: 307


View Profile WWW
« Reply #2 on: 2006/12/02 14:21:11 »

Damn, ill get a permalink, sorry about that.
Either way its the latest post, so going to the mainpage will find it for you.

[EDIT] Okay... It works fine for me, well here are the direct links to the PDF and Source Code.
[PDF]
[ZIP]
Logged

ericc59
Jr. Member
**
Offline Offline

Posts: 50


View Profile
« Reply #3 on: 2006/12/02 23:45:16 »

Great stuff man.  Thanks for taking the time to write this up.. it's a great addition to the engine.  It seems there's almost no resources on setting up a post-processing framework.
Logged
mikeschuld
Administrator
Sr. Member
*****
Offline Offline

Posts: 389


View Profile WWW
« Reply #4 on: 2006/12/03 05:59:44 »

Found one problem with it though Smiley Somebody had to.

Instead of checking for myPostProcessor.Shader != null in the LoadGraphicsContent function of HMGame, it should be checking for the shader asset string not being null. To allieviate the problem, I made the following changes:

Code:
// In HMPostProcessor
public Effect Effect // instead of 'Shader' for less confusion
{
    get { return myEffect; }
    set { myEffect = value; }
}

public string Asset {
    get { return shaderFileName; }
}


// In HMGame
if (myPostProcessor.Asset != null)
    myPostProcessor.LoadGraphicsContent(myGraphics.GraphicsDevice, myContent);


Also, I will probably be adding this by hand to my own codebase, and so some of the names of things will change in my code to more closely match the overall naming of similar items in the other tutorials (myLoader instead of myContent, etc.) The code will overall be exactly the same though, it will just be easier for me to think and look at stuff I have been working with. I'm sure you guys all do this to your own code anyway so no biggie Smiley


Everything works otherwise, see LOOK!!!

Code:
float4 Post_Pixel(float2 tex : TEXCOORD0) : COLOR0
{
float4 col = (float4)1.0f - tex2D(samp, tex);
return col;
}

[attachment deleted by admin]
« Last Edit: 2006/12/03 06:14:00 by mikeschuld » Logged
letsrock
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #5 on: 2006/12/03 10:58:59 »

I cant download the files nor i could browse the page... Cry
Logged
jadams
Newbie
*
Offline Offline

Posts: 14


View Profile
« Reply #6 on: 2006/12/03 19:33:21 »

Yea, I couldn't download the files either. When I go to the home page, it lists a bunch of pascal stuff... I'm buummed too. The invert jpg looks way slick.
« Last Edit: 2006/12/03 19:43:22 by jadams » Logged
Chr0n1x
Global Moderator
Sr. Member
*****
Offline Offline

Posts: 307


View Profile WWW
« Reply #7 on: 2006/12/03 19:53:55 »

@mikeschuld
Yeah that would probably be better, either way it works.
The names are different because I was doing more of an adaptation from my teams engine to yours, since I was doing both at the same time. Effect as the name works fine, I didn't use it because I personally don't like to use the same name twice, even though its separated.

To everyone else, I will put the tutorial and source up on my Filefront account as a mirror, in case something is wrong. I do not understand whats going wrong, it could possibly have been my host was down at that point,? but it should be listed right at the top, dated December 2nd.

Links here when i'm done.
[DONE]
http://files.filefront.com/postprocessingpdf/;6294268;;/fileinfo.html - [PDF]
http://files.filefront.com/hmengine_postprocessingzip/;6294267;;/fileinfo.html [ZIP]
« Last Edit: 2006/12/03 19:58:28 by Chr0n1x » Logged

letsrock
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #8 on: 2006/12/04 00:33:53 »

now it works...  Smiley
Logged
mikeschuld
Administrator
Sr. Member
*****
Offline Offline

Posts: 389


View Profile WWW
« Reply #9 on: 2006/12/04 03:04:47 »

I actually refactored it a bit as well for more of a software engineering look at it as opposed to the optimization side of things. Since optimization and software engineering are worst enemies, I have mostly been ignoring the optimization issues in the tutorials as it keeps the code a bit easier to read. I will simply have a version implemented in my source zips and post it here without the .pdf since they aren't quite the same.

This should also tell people that if they are finding they need a few more fps here and there that using your version of the code will be a better idea, but if they are still having trouble understanding how it all fits in, they should take a look at mine as well to see if it can't help remedy some confusion.
Logged
Chr0n1x
Global Moderator
Sr. Member
*****
Offline Offline

Posts: 307


View Profile WWW
« Reply #10 on: 2006/12/04 03:09:55 »

Good idea, I am not one who is great at code understandability, thats why I hoped my tutorial explain it, thats why it was rather long.
But I like to keep code neat and optimize as much as I can, so I can provide that alternative.

Guess we have found a good way to work together! Wink
I may take a look at more ways to optimize your other tutorials now that I have PIX understood, but that will only be after your culling tutorial.
Logged

Chr0n1x
Global Moderator
Sr. Member
*****
Offline Offline

Posts: 307


View Profile WWW
« Reply #11 on: 2006/12/04 20:24:51 »

Sorry to double post, but Mike you need to see this.
For the meanwhile something with my hoster screwed up and it seems the blog post and files are gone. So when I get the chance I will reupload.
In the meanwhile just use the filefront links.
Logged

mikeschuld
Administrator
Sr. Member
*****
Offline Offline

Posts: 389


View Profile WWW
« Reply #12 on: 2006/12/05 04:39:11 »

I'll update the links in the post on the main site till it's back to the right place.
Logged
slugonamission
Newbie
*
Offline Offline

Posts: 4


View Profile
« Reply #13 on: 2006/12/08 15:33:57 »

Rather annoyingly, I can't get this to work Sad

To load the shader, I have
game.PostProcessor.SetPPShader(@"Content/Shaders/PostProc");
            //game.PostProcessor.ReloadEffect(game.Content);

If I uncomment the second line, I just get a white screen drawn, so I'm assuming the first line alone is not enough to load the shader.

Also, and this is really strange, if I change the compile version of the shader to 3.0, it will throw a null reference exception trying to access Effect.CurrentTechnique.Passes. If however, I try to create an inversion effect, it will compile and run fine with SM3...Any ideas?
Logged
Chr0n1x
Global Moderator
Sr. Member
*****
Offline Offline

Posts: 307


View Profile WWW
« Reply #14 on: 2006/12/08 16:22:37 »

Okay, the second line there is not needed, as long as the 1st line is being called before the content laoder loads on startup. I just added that method for if you want to change the shader midgame. More of a convenience function really.

But you say it doesn't work both ways...
Have you tested the zipped source code by itself? to see if that works?
Logged

Pages: [1] 2 3 4
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Tutorial 14 Hazy Mind 3D Engine serus 3 3901 Last post 2008/12/19 10:32:01
by mikeschuld
Tutorial 1 :: Introduction to the XNA Framework Tutorial Discussion « 1 2 3 » mikeschuld 32 12695 Last post 2007/08/14 21:46:09
by mikeschuld
Tutorial 2 :: Scene Graph and Object Framework Tutorial Discussion « 1 2 » mikeschuld 18 10053 Last post 2008/07/31 22:50:22
by mikeschuld
Next Tutorial Hazy Mind XNA Engine mikeschuld 12 4871 Last post 2006/11/12 15:40:51
by mikeschuld
Having issues with tutorial 3 Hazy Mind XNA Engine siferion 4 2377 Last post 2006/11/26 14:04:03
by mikeschuld
Tutorial 3 Hazy Mind XNA Engine hansonc 4 2482 Last post 2007/03/27 09:23:23
by hansonc
Post Processing Hazy Mind XNA Engine Robin Sarac 3 1595 Last post 2007/04/21 19:23:20
by Arkcann
Tutorial 2 Hazy Mind XNA Engine Classicwarrior 5 2687 Last post 2008/05/17 23:01:31
by Classicwarrior
Post Tutorial 8 - advice needed! Hazy Mind XNA Engine solthar 5 2245 Last post 2008/09/03 20:47:57
by solthar
Powered by MySQL Powered by PHP Powered by SMF 1.1.12 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.391 seconds with 20 queries.