PDA

View Full Version : need help in code optimization...



sudhanshu
03-24-2009, 02:18 AM
i am makin a big picture using small triangles and then texture mapping the picture on the triangles by specifying texture coordinates for each coordinate of each triangle...
(i am using 1200X1200 small continous triangles to make a big picture)

i am also providing facility to rotate in any direction...

problem occurs when i try to rotate the picture because for each rotation all the triangles are drwan again for new set of values and texture mapping is performed again too

this takes whole lot of processing which makes the output very slow.

is there any way this issue can be handled and my program works little more smoothly????

Ilian Dinev
03-24-2009, 02:41 AM
I guess the same techniques used in projective texturing are needed. Regular shader to draw things from one viewport, shader that does maths on the texcoords - to draw things with the projected texture.

Projective shadowmapping is a cousin to these techs, so reading a bit about it won't be a waste.