Motherboard Forums


Reply
Thread Tools Display Modes

Vertex shaders might be able to do scatter.

 
 





















Skybuck Flying
Guest
Posts: n/a

 
      10-01-2009, 03:52 AM


Hello,

Suppose pixel 0 wants to write to pixel 5 in a pixel shader... then this
cannot happen on DX9 graphics cards.

pixel 0 can only write to pixel 0.

However

What if a second pass is used...

pixel 0 could output a 5 to indicate to the next pass that it's output must
go to pixel 5.

So on the next pass... a vertex shader which is "coupled" to location 0
which is pixel 0...

The vertex shader should have access to the texture map of the previous
pass.

Thus the vertex 0 in the shader could use a texture lookup to read pixel
0... it would then also discover/read that pixel 0 wants to go to pixel 5.

So the vertex moves itself to location 5 and thus the vertex shader outputs
the updated position for the vertex.

I am not sure what will happen... I am not sure which pixel will be called
for the pixel shader...

If vertex 0 activates pixel 5 in the pixel shader... then pixel 5 will be
able to read the input data from the vertex... (the vertex would have
outputted the pixel0).

Thus pixel 5 can now read pixel 0 without pixel5 knowing that pixel0 wanted
to move there... if I wanted to know it would have to scan the entire
arrray... not so with this technique... because pixel0 knows that it wants
to move to pixel5... so pixel5 couldn't care less where the pixel came
from...

However if pixel5 wants to know then ofcourse that information can be given
by the vertex0 as well

So far the theory... I think it could work... so an experiment will follow
shortly...

But now I have to go eat nice warm dinner !

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      10-01-2009, 03:59 AM
Wikipedia comes very close to this idea...

Except for the last line... it mentions an immediate gather operation...
such an immediate gather operation would require a whole scan... and
comparisions this is not necessary and inefficient.

However wikipedia did mention the "move vertex" trick...

But it seems to fail to link the two together...

So it doesn't mention the possibility of the vertex shader to read the
address from the previous output and simply move to there...

So I am not sure if they actually had the same idea as me... it would seem
like it... but the devil is in the details and so far they provided no real
details... just general vague clue's...

General vague clue's are not enough... one either knows exactly how to do it
or not...

Well I have described an exact method... I just don't know if it works
yet...

If it does work... could I be considered the inventor of this trick ?

Unless counter evidence is presented that somebody else already invented it
*exactly( then I remain skeptical !

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      10-01-2009, 06:03 AM
Funny wikipedia even has a "vague" tag on that section !

Oh I never included the link lol... oh well keep it like that you bastards !
LOL

I know you love me

Bye,
Skybuck =D


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      10-01-2009, 08:44 AM
These output addresses could probably be written to an "(output/input)
address texture map".

As to not disturb the original texture map so still lots will fit in it


To be tested. First I probably need to write some new code to get rid of the
TopenGL component which is probably no longer needed Since offscreen
rendering is now possible

Also vertex arrays still need to be investigated

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      10-01-2009, 09:27 AM
I am just going to transform my code a little bit... easier that way

Bye,
Skybuck =D


 
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



All times are GMT. The time now is 05:49 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