SFML community forums

Help => Graphics => Topic started by: EClaesson on August 11, 2009, 02:52:15 am

Title: PostFX for computors without support for it
Post by: EClaesson on August 11, 2009, 02:52:15 am
Hi there.

I'm sitting on a fairly new Laptop (yes i know, crappy gfx-card) but it at least support PixelShader 2.0. But i guess the total lack of any VertexShader support and HW T & L is the problem.

Is it possible to run PostFX on gfx-cards like mine?

I have my small plans on implementing my own, using some lightweight scripting language such as GameMonkey. This could use GetPixel() to get the color and give me the new color. The problem i have is that there are no SetPixel() (afaik).

Laurent, take this as a feature request maybe? :wink:

Would this bee way too slow? It may mean that every pixel of the screen has to be read and written every frame.

Thanks in advance for your answers.  :)
Title: PostFX for computors without support for it
Post by: Laurent on August 11, 2009, 07:54:37 am
Quote
Is it possible to run PostFX on gfx-cards like mine?

Not if sf::PostFX::CanUsePostFX() returns false.

Quote
This could use GetPixel() to get the color and give me the new color. The problem i have is that there are no SetPixel() (afaik).

sf::Image::SetPixel(x, y, color).

Quote
Would this bee way too slow? It may mean that every pixel of the screen has to be read and written every frame.

Definitely. At least you should directly work on the array of pixels, and re-uploading them once per frame with sf::Image::LoadFromPixels.
Title: PostFX for computors without support for it
Post by: EClaesson on August 11, 2009, 10:33:18 am
Quote
Definitely.

Definitely.. too slow?
Title: PostFX for computors without support for it
Post by: Laurent on August 11, 2009, 10:43:29 am
Quote
Definitely.. too slow?

Yep. Especially if you target old configurations.
Title: PostFX for computors without support for it
Post by: EClaesson on August 11, 2009, 10:45:07 am
Quote
Yep. Especially if you target old configurations.


Not old really. Just for systems which doesn't support advanced shaders. Like my laptop, dualcore cpu, 2gb ram, weak/integrated gfx-card and such.
Title: PostFX for computors without support for it
Post by: EClaesson on August 12, 2009, 03:48:57 pm
Quote from: "Laurent"
At least you should directly work on the array of pixels, and re-uploading them once per frame with sf::Image::LoadFromPixels.


Does LoadFromPixels want a miltidimensional array, or a "single"? And what type does it expect the pixel values to be?
Title: PostFX for computors without support for it
Post by: Laurent on August 12, 2009, 03:59:41 pm
Quote
Does LoadFromPixels want a miltidimensional array, or a "single"? And what type does it expect the pixel values to be?

It's all in the documentation ;)

--> Single array of 8-bits RGBA components.