Hi Art,

Art Tevs wrote:
J.P. Delport wrote:
Do you want TextureRectangle support in osgPPU?


Yes, of course. However I thought that rectangular textures might not
be used in future anymore, because the support of non-power-of-two
(npt) textures can actually replace the rectangular textures. The
main difference, imho, is in specifying coordinates, so that one can
use also npt textures while recomputing the coordintes in the
shaders. So, to be honest, I do not know of any case where
rectangular textures are really helpful. This was the reason, why I
have never tried to add support for them into the pipeline.

I'm also leaning more and more away from rects. I just have to convince all our image processing people that coordinates != pixels :)



The main difference is the setup of the quad to be rendered: if the
 input texture is a rect, then the quad coords must be set up
correctly. I've done this at the top of init() in UnitInOut, but
want to know if you think this approach is correct? Maybe a change
in the utility function?


Yes, this seems to be the trick part. I would not prefer to have a
special case in UnitInOut::init which changes the coordinates in case
of rectangular texture. I would propose to use multiple texture
coordinates. As soon as a unit becames dirty, so that it has to setup
its inputs, one do creates screen sized quads with multiple texture
coordinates. The coordinates should of course correspond to the input
index. So that if rect-texture is on 2nd input then only 2nd
coordinates should be changed. This would guarantee that always
correct coordinates are used in the shaders as long as user do
understand what he is doing ;)

I like the multiple coord idea. It seems that the only place where the textured quad is created is in createTexturedQuadDrawable and that is only called from init() in the various units. Do you propose I add the extra tex coordinates in this function? Is it OK if I access mInputTex in createTexturedQuadDrawable to get the input rect size?

Is it necessary to create coords per input texture, or would it be OK to always just generate two sets: one for normalised range and one for rects? This assumes that all input rectangles to a unit has the same size?

regards
jp



Some language and spelling things were changed. You can merge them
if you like.


Oh thank you very much. I will merge the changes soon.


Regards, art

------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20802#20802





_______________________________________________ osg-users mailing
list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to