[AGS THEORY] Pixel Shaders

Started by Calin Leafshade, Tue 29/12/2009 15:55:41

Previous topic - Next topic

Calin Leafshade

So this is really a kind of hypothetical question but how hard would it be to make AGS support pixel shaders? Specifically HLSL shaders.

I mean i imagine the D3D driver already uses pixel shaders to some degree.. tinting perhaps.

It would be very interesting to apply certain pixel shader effects to AGS games (specifically post processing ones like bloom)

Thoughts?

NsMn

It would actually possible, using the "pipette" function for DrawingSurfaces, get the RGB values, modify them and store them in ints, and paint over the old pixel with the colour with those new RGB values - Only downside, it would take ages to process one single pixel.

Calin Leafshade

Well yeah i know that would be possible since we have direct access to the pixels on the screen.

However if we could do it with Pixel Shaders it would be lightning fast since we are using the GPU.

GarageGothic

It's technically possible to do it with GetPixel, but in practice it's much too slow to do in real-time. I tried to write a very simple shader that converted a color image to grayscale (redundant, I know, since you can use the tint function, but it was just a test) and when called from the rep_exec the frame rate dropped to 3-4 fps.

Pumaman

Yes the D3D driver already uses a pixel shader to do sprite tinting. It might be possible to allow you to use a custom pixel shader -- obviously this wouldn't work in DX5 mode but it depends if anyone else would actually use this feature?

Calin Leafshade

#5
ignore these fools. I WOULD USE IT!

no but in seriousness it would be very nice to be able to harness the GPU for full screen effects.

it would allow for

Full screen tinting,
bloom,
blur,
brightness/contrast effects
plus about a billion other things

Edit: Also displacement maps.

Dualnames

Quote from: Calin Leafshade on Tue 05/01/2010 22:49:01
ignore these fools. I WOULD USE IT!

no but in seriousness it would be very nice to be able to harness the GPU for full screen effects.

it would allow for

Full screen tinting,
bloom,
blur,
brightness/contrast effects
plus about a billion other things

Edit: Also displacement maps.

Sparky would kill for the edit. I think yes, if it's not much of a pain!
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Scavenger

Displacement maps, and the blur shader would be most use to me, I think - I like simulating depth of focus, and AGS is sadly lacking in these things. Machinarium did a pretty neat job of simulating it, and not having to do the blur effects manually would be a lifesaver.

So sign me up for supporting pixel shaders!

Calin Leafshade

some of the post process effects it allows for can be quite spectactular.

Imagine tint, bloom and contrast.. you have a believable old film effect.. not just a shit overlay like McCarthy.

It would give us something to boast about when wintermute fans saunter over  ;D

SMF spam blocked by CleanTalk