Main Page | Report this Page
Computers Forum Index  »  Computer - Games Development (Design)  »  Interesting idea: modifieing vertex coordinates and...
Page 1 of 1    

Interesting idea: modifieing vertex coordinates and...

Author Message
Skybuck Flying...
Posted: Fri Oct 02, 2009 1:10 pm
Guest
http://www.ogre3d.org/forums/viewtopic.php?f=1&t=48854

^ This idea above is interesting

I imagine it could work as follows:

Vertex shader:
1. A vertex buffer is filled with 4096x4096 verteces.
2. All verteces positions coordinate correspond to the x and y position of
the buffer/screen/output.
3. The verteces TEXCOORDS can be used as outputs and can be
manipulated/modified.

Pixel shader
4. The pixel shader simply outputs the TEXCOORDS as "colors" into the
same/secondary vertex buffer.

This way the modifications made by the verteces can be saved to output...

This would allow the verteces to be updated each pass/round... and therefore
the verteces can "fly" anywhere Wink :)

Could be nice for a particle system.. or "3d model" transformations which
need to be stored... or done multi passes... or change slowly over time.

This might even be used to blow holes in models... the vertex modifier...
could try to "repair the blown holes" with some kind of algorithm...
therefore the models could literally be shot to pieces over time ! ;)

Bye,
Skybuck.
 
Skybuck Flying...
Posted: Fri Oct 02, 2009 1:16 pm
Guest
However a little bit more explanation is needed for the algorithm...

The true TEXCOORDS would come from the texture map that was updated/render
to from the last round.

Therefore the vertex shader would load the "true" vertex positions from this
texture map.

So in short:

The texture map contains the "vertex positions/coordinates".

vertex shader code would look something like:

TEXCOORD0 = tex2D( sampler2D, Position );

or for rectangular texmaps:

// rectanguler texmaps. (can't remember exact function name but something
like that)
TEXTCOORD0 = texRECT2D( samplerRECT2D, Position )

pixel shader would just do:

out.x = texcoord0.x
out.y = texcoord0.y
out.z = texcoord0.z

Make sure textcoord0 are in 3D to get an x,y and z if needed.

So texture map should have x,y,z as well as "colors"... rgb...

^ Fun stuff for kids Wink :)

Bye,
Skybuck.
 
Skybuck Flying...
Posted: Sat Oct 03, 2009 12:54 pm
Guest
OpenGL 3.0 might have a feedback buffer... which might be faster... ? It
doesn't really say... but I imagine the modified verteces would not have to
go through the pixel shader ?

Bye,
Skybuck.
 
Skybuck Flying...
Posted: Sat Oct 03, 2009 12:56 pm
Guest
Also another adventage of the feedback buffer could be that verteces are not
clipped ?!

So no matter if they go outside the window they would still be returned...

This way the texcoord's might not have to be used as I described...

Thus less space required... the texture look ups might also not be needed
anymore...

So all in all could make things faster ! ;)

Bye,
Skybuck.
 
 
Page 1 of 1    
All times are GMT
The time now is Sun Dec 06, 2009 8:40 pm