I'm out of date on full-screen shaders...

Posted By: Ichiro

I'm out of date on full-screen shaders... - 12/07/09 18:50

Hey all,

I'm trying to get back onto the full screen shader wagon.

(A new way of handling full screen shaders may have passed me by since I looked last -- I've tried a few searches (ex.), but I came up empty.)

Here are my parameters:

- We're using a screen-aligned quad
- Last time we did that (in Wonderful), ALT-TAB crashed the game
- Technique that'll work at multiple resolutions
- We're using C-Script

Any advice?

Thank you!
Posted By: Puppeteer

Re: I'm out of date on full-screen shaders... - 12/07/09 21:35

Originally Posted By: Ichiro

- We're using C-Script


It might be time to switch to lite-c... i too refused to do that for a long time but it's really worth the script conversion.
And converting c-script scripts to lite-c is really really easy. mostly you have to change some stuff to capital letters and thats pretty much it... I don't how big your script collection actually is but i think you can pull it of in one week.
It's really worth it tongue
Posted By: Ichiro

Re: I'm out of date on full-screen shaders... - 12/07/09 22:13

You're right; it's far past time. laugh But my team's versed in it, and all our legacy code is there.
Posted By: JibbSmart

Re: I'm out of date on full-screen shaders... - 12/07/09 22:23

I don't know if this works in C-Script, but with Lite-C you don't need screen-aligned quads. You can actually post-process a screen very easily (look up PROCESS_TARGET), and the shader is given useful parameters such as the size of a pixel.

You can also very easily link stages together this way. Look up "stage" in the manual. You'll like what you see. The shader workshop also has a couple of really good examples of its usefulness.

BTW, in Aaaaaetc (I was playing it yesterday, and thoroughly enjoying it!), I still get a small floating quad during some of the videos that floats a distance in front of the screen with black edges -- it looks very much like it is meant to be a screen-aligned quad, but is too far forward.

Jibb

PS: If you really can't move on from C-Script, and if you haven't done so already you could set up your pp-shader to texture the screen-aligned quad in view-space, instead of using its texture co-ordinates. That way, the quad doesn't have to be perfectly aligned with the screen, as long as it covers it completely.
Posted By: Ganderoleg

Re: I'm out of date on full-screen shaders... - 12/07/09 23:16

Hello,
If you want to keep C-Script code and still use Lite-C stages you can easily combine those two. I'm using both in my game for the very same reason.

Only set-back is that I wasn't able to use game_load because PPE is simply not active after that instruction. On the other hand level_load works just fine so I have replaced game_save with simple save system that uses file_var_write and everything works just fine.

I would consider it if you wanna keep C-Script and still have nice looking PPE in Lite-C.
Posted By: Ichiro

Re: I'm out of date on full-screen shaders... - 12/08/09 00:22

Aha! Thank you both. laugh

> BTW, in Aaaaaetc (I was playing it yesterday, and thoroughly enjoying it!), I still get a small floating quad during some of the videos that floats a distance in front of the screen with black edges -- it looks very much like it is meant to be a screen-aligned quad, but is too far forward.

Yeah; we actually changed camera.arc, and accidentally left a view entity in there. Alas.

> If you want to keep C-Script code and still use Lite-C stages you can easily combine those two. I'm using both in my game for the very same reason.

That sounds like it's just what I need! It this just a matter of creating a Lite-C script, and include<>ing it my C-Script file? I've done a few searches for such with the handy-dandy A7oogle utility, but wasn't able to turn anything up on combining the two.

Thanks!
Posted By: lostclimate

Re: I'm out of date on full-screen shaders... - 12/08/09 00:53

its all much easier in a7 but im not sure how it works in cscript. if your looking for lite-c programmers, me and julz are both looking for work most of the time grin and now that I'm back into doing freelance I have time to do it. grin
Posted By: Ganderoleg

Re: I'm out of date on full-screen shaders... - 12/08/09 01:13

Yes that's about all you have to do smile

My main C-Script has...

include <PPE_Start.c>;

...and in PPE_Start.c I have...

#define PRAGMA_PATH "shade-c" //if you use Shade-C
#include <acknex.h>
#include <default.c>
#include "mtlView.c"
#include "sc_core.c";
//if you use Shade-C

...because I also use Shade-C HDR.

Now you can use and chain stages...

camera.stage = viewBleach;
viewBleach.stage = viewDesat;
viewDesat.stage = viewColor;
//viewBleach,Desat&Color are my own views- i can't remember the original GS PPE view names

...or/also Shade-C...

sc_setup();

...that's all.

Btw:
If you want antialiasing you will have to use ChrisB fullscreen antialiasing plugin...
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=263055#Post263055
...because d3d_antialias will now be totally useless smile

Btw Btw:
I forgot very, very important thing blush
In PPE_Start.c you need a startup function because your function main is in C-Script and Lite-C can't see actions assigned in WED or C-Script.
So you need...

void ppe_startup()

...and everything works out.
Posted By: JibbSmart

Re: I'm out of date on full-screen shaders... - 12/08/09 05:44

Quote:
me and julz are both looking for work most of the time grin
Indeed we are! grin I'm unavailable for the next few weeks as I move to Canada (I'm just about to pack up this computer now), but in future I'd be very keen to work on a Dejobaan Game!

Jibb
Posted By: Ichiro

Re: I'm out of date on full-screen shaders... - 12/08/09 18:40

LC/JM> me and julz are both looking for work most of the time

Thanks for the heads-up; we're set for now, but I'll let you know if/when we're looking. Only one out of the 3 programmers we have knows how to use C-Script. Oy. laugh

GOleg> Yes that's about all you have to do

Thank you! It's doing some really weird things (exiting on ESC?), but I think it actually means things are starting to work! Woo!
Posted By: SchokoKeks

Re: I'm out of date on full-screen shaders... - 12/08/09 18:51

Originally Posted By: Ichiro
It's doing some really weird things (exiting on ESC?), but I think it actually means things are starting to work!


try remove the line
#include <default.c>
That file defines standard keys, like quitting on esc and f10, changing screen res and quicksave and quickload, which might overwrite what you have set in c-script.
Posted By: Ganderoleg

Re: I'm out of date on full-screen shaders... - 12/08/09 20:40

No problem smile I'm glad I was able to help out smile

As for esc I'm not sure- I have default.c included in my script and everything works fine. To be honest everything works fine also if I exclude it so... both are o.k. in my case. My GS version is commercial 7.50. Maybe that has something to do with it.

Btw- you can't share your vars between C-Script and Lite-C but you can use engine vars to communicate between them.
I use turb_speed for kick-effect: when enemies hit player I set turb_speed to 2 in C-Script and that triggers shake ppe in Lite-C. After 0.5 sec shake turns turb_speed back to 1.
Posted By: Ichiro

Re: I'm out of date on full-screen shaders... - 12/08/09 21:25

> try remove the line
> you can use engine vars to communicate between them

Aha! Great to know. Thanks to you both. laugh
Posted By: Puppeteer

Re: I'm out of date on full-screen shaders... - 12/08/09 22:52

Originally Posted By: Ichiro
You're right; it's far past time. laugh But my team's versed in it, and all our legacy code is there.

Well it took me ~1 hour to get into lite-c and to be able to convert all my c-script code to lite-c, it really only is a matter of capital letters and the precompilers. And it would enable you to use all the additional lite-c functions available.
© 2024 lite-C Forums