home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Shader on Pain...

by conorfjdhfsdhfdhsfkshkdj on 12/22/2007 23:00, 5 messages, last message: 12/23/2007 08:31, 1112 views, last view: 05/01/2024 04:51

Is it possible to have the engine switch to a fullscreenshader when you get hurt? I wanted to try this cool little effect that when you get hurt, it blurs your vision for a small amount of time (Like a few hundred milliseconds...)

I was poking around the code but I don't know exactly what to do :)

   Board Index   

#1: ..

by MovingTarget on 12/22/2007 23:31

Write your full screen shader, and modify the code so that whenever you get hurt, it calls the /setfullscreenshader function with your shader as the argument. By the way, put your shader in stdshader.cfg.

reply to this message

#2: ..

by SheeEttin on 12/22/2007 23:46

Hmm...
I'd examine what happens when you execute /setfullscreenshader (search for "(setfullscreenshader") and see if you can adapt it to execute on taking damage and revert after a second or so (or maybe longer depending on damage).

BF puts an overlay on the HUD when hurt. You could try looking at that for some help.

reply to this message

#3: setfullscreenshader...

by conorfjdhfsdhfdhsfkshkdj on 12/23/2007 04:15

Setfullscreenshader appears twice in the sauerbraten source.


One if a C++ function, which I suppose handles the obvious part, and the next is when it is defined as an in game command.


It appears that when the player gets hurt, I could call (in the C++ code) setfullscreenshader();

The only problem is, I am not a c++ wizard, so if I read through the declaration of setfullscreenshader, I don't understand what to send it?


setfullscreenshader(what?);

reply to this message

#4: Re: setfullscreenshader...

by MovingTarget on 12/23/2007 04:53, refers to #3

setfullscreenshader(yourshaderdefinedinstdshader.cfg, param, param, param, param). Bloom only uses the first param by the way.

reply to this message

#5: Oh!

by conorfjdhfsdhfdhsfkshkdj on 12/23/2007 08:31

Ok! Now, to find where the pain occurs :) I may be wrong, but isn't there a different pain function for the different game types?

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53869008 visitors requested 71644196 pages
page created in 0.023 seconds using 10 queries
hosted by Boost Digital