Motherboard Forums


Reply
Thread Tools Display Modes

Multiple colors/pixels/outputs per pixel for pixel shaders on DirectX9 graphics cards (OpenGL 3.0) ?

 
 





















Skybuck Flying
Guest
Posts: n/a

 
      09-26-2009, 07:39 AM


Hello,

I am wondering if it's possible to output multiple colors/pixels/outputs per
pixel for a pixel shader ?

So instead of

Float4 PSMAin()
{

}

It would be something like (conceptually):
Float4 Float4 Float4 Float4 PsMain()
{
Return Color0/Pixel0/Texture0
Return Color1/Pixel1/Texture1
Return Color2/Pixel2/Texture2
Return Color3/Pixel3/Texture3
}

These could be stuffed into a structure to make it look more nice... for
example:

FourPixels PsMain()
{
Return FourPixels;
}

However I wonder if this can work on DirectX9 graphics cards because I never
tried it...

I also wonder what the necessary opengl bindings would be...

Probably 4 buffers attached to some frame buffer object and use render to
texture ?

The following document mentions 4 output semantics for pixel shaders:

COLOR0, COLOR1, COLOR2, COLOR3

This is related to CGFX.

Using_SAS_v1_01.pdf

I am not sure if these can all be used at the same time for a pixel
shader... as demonstrated in the examples above...

Can somebody please enlighten me ?

Euhm to be clear, this feature could be handy for gpgpu programming... so
more state can be kept, processed and passed through the pixel shaders from
pass to pass.

Thank you for any answers,
Bye,
Skybuck.


 
Reply With Quote
 
Bo Schwarzstein
Guest
Posts: n/a

 
      09-27-2009, 01:09 PM
On Sep 26, 2:39*pm, "Skybuck Flying" <BloodySh...@hotmail.com> wrote:
> Hello,
>
> I am wondering if it's possible to output multiple colors/pixels/outputs per
> pixel for a pixel shader ?
>
> So instead of
>
> Float4 PSMAin()
> {
>
> }
>
> It would be something like (conceptually):
> Float4 Float4 Float4 Float4 PsMain()
> {
> * * Return Color0/Pixel0/Texture0
> * * Return Color1/Pixel1/Texture1
> * * Return Color2/Pixel2/Texture2
> * * Return Color3/Pixel3/Texture3
>
> }
>
> These could be stuffed into a structure to make it look more nice... for
> example:
>
> FourPixels PsMain()
> {
> * * Return FourPixels;
>
> }
>
> However I wonder if this can work on DirectX9 graphics cards because I never
> tried it...
>
> I also wonder what the necessary opengl bindings would be...
>
> Probably 4 buffers attached to some frame buffer object and use render to
> texture ?
>
> The following document mentions 4 output semantics for pixel shaders:
>
> COLOR0, COLOR1, COLOR2, COLOR3
>
> This is related to CGFX.
>
> Using_SAS_v1_01.pdf
>
> I am not sure if these can all be used at the same time for a pixel
> shader... as demonstrated in the examples above...
>
> Can somebody please enlighten me ?
>
> Euhm to be clear, this feature could be handy for gpgpu programming... so
> more state can be kept, processed and passed through the pixel shaders from
> pass to pass.
>
> Thank you for any answers,
> * Bye,
> * * Skybuck.


I'm sorry that I am not familar with DX but OpenGL. Since GL 2.0, your
GPU could use MRT in your Pixel Shader to output data into texture
render targets.

They could be used at the same time if you prepared the enough render
targets to retreive the data. In fact the GPU could output unlimited
render targets but the boundwidth is the greatest problem . As I known
current GPU supports at most 4 render target, e.g, 4x4=16 FP32
scalars, that should be enough for defered shading.
 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-30-2009, 10:45 AM
Ok,

Question for you:

Suppose the frame/texture buffers are not cleared.

Suppose only a few verteces are drawn with gl_points.

This would trigger only a few pixel shaders.

What will MRT do ?

Will it only update the pixels from the pixel shaders on the multiple render
targets ?

Or will MRT start copieing everything ?

Bye,
Skybuck.


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two different PCI-E graphics cards - possible? rpgs rock dvds Asus 9 06-12-2008 01:57 PM
Difference between two graphics cards n o s p a m p l e a s e Acer 0 09-23-2007 04:58 AM


All times are GMT. The time now is 03:26 AM.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43