perfect dark concussion graphical effect (in real time)

(z3r0 d) #1

I think I know how in perfect dark (BTW, I don’t actually own this game) messes up your vision when you get hit really hard, or injured (or whatever), and I wonder if it would be possible to do in the real time version of blender. I don’t know opengl, and am not very good at python, but I think I have planned this out well enough so that someone who did could judge feasibiltiy

ok, here goes:
you need:

  • access to each frame that is rendered (before it is displayed to the screen)
  • access to an image buffer of the same size
  • a way to combine the two with a variable amount of opacity (of the currentFrame)

so then, each frame that is displayed on the screen is the combination of the buffer, and the current frame with the opacity variable. This is stored back to the buffer. On the first frame the opacity is full. The opacity will have to be adjustable to account for the varation this effect would cause with an inpredictable framerate on the user’s computer.

I hope that made sense. here is a lower level explination: (nothing new here if the above made sense)

prevFrames # the image buffer
opacity # starts at full

on each new frame # before it is rendered
# combine the buffer, and the current frame
theCurrentFrame = combined(prevFrames, theCurrentFrame, opacity)
# should be a copy of the image, not the pointer, or handle
prevFrames = theCurrentFrame

what will it look like (in therory)?
assuming that the opacity has been set lower, and we are currently viewing something significantly after the first frame it would look like motion blur gone more than crazy, and the current position would be difficult to distinguish from the previous ones.

Unfourtunately I can not put my mind’s pictue of this into this explination, but I hope you can understand.

Good Luck!

(wiseman303) #2

just add a plane, put it in front of the camera, map the image you want as a texture. Then creat an alpha IPO and use an IPO actuator set to property.

Then you can change the opacity of the image by changing the property.

(z3r0 d) #3

the thing that I would like to have in that plane (perfectly lined up with the screen) would be a combination of the previous frames.

it is not possible without any code

… and how would I change the texture to something that can not be predicted in advance in real time?

(SeaCigar) #4

Ohh… sounds tough :-? not only would you need to know how to break into blender’s program to find the visual data of previous frames, such a refresh rate may be tough to handle by all but the best 3D systems. If you researched perfect dark, you know that Rare had their problems with the game engine for a while. I have to say that It really floored me the first time my arse was really kicked in that game; its a realistic (and hilarious) effect, and a great way to show that your char is really hurting. I’m sorry I couldn’t help, though… perhaps an easier way would be to change what the camera is looking like (as in how it sees objects) with python script…

Although I am no python wiz, listen to this… I have a game im working on myself, and I have my character walk left when I push left, and walk right when I push right… So what does that have to do with this? Well, my character doesn’t know how to move when you push BOTH buttons, making him blur between facing left and facing right. I believe, that if you had the camera viberate quickly enough between two points side by side, you could create a sort of “Double Vision” effect . And by moving those two points closer and farter apart over a period of time, it looks like the vision is coming in and out of focus. I hope that helps, as I’d like to see more special effects in blender!

(z3r0 d) #5

What about with the Blender.BGL module

I have the documentation (of it and a good deal more) at

be patient it is big.

the problem is that I don’t know if opengl will allow you to modify the order in which it renders things, and access the rendered image (maybe some derivative of a screenshot is in order…?)

tecnically I only have to access the current frame (2 times: 1 read, 1 write) before it is drawn on the screen.

I don’t know.

(wiseman303) #6

Hmm… Maybe you could use the Rasterizer.makeScreenShot(), and use python to change the texture of the plane to the saved image. I’m not sure exactly how to do this, but it’s got to be easier than breaking into blender’s opengl settings.

(saluk) #7

Hey, youve got a point there wiseman. If you set up something with a non-packed texture, and have python do a makescreenshot and save the image over the old texture, will it update it? My feeling is that the texture is already in memory and it wont recheck the file until you either restart the game or restart blender but its worth a try.

(Pooba) #8

Sounds like you guys are on to something. Let me know when you get it done.


(guru202) #9

This may help you figure things out.
Go to
I wish you the best of luck :slight_smile:

(jeotero) #10

take screenshot and put in front of the camera with some alpha transparency and a fade out ?