Hi Werner, The type of problem you are working to solve is very domain specific so you'll need to write your custom shaders to support it, what you are looking requires relatively advanced knowledge of OpenGL and various associated rendering techniques. If the material is translucent then you will need to handle the issue of depth sorting or depth pealing to make sure that the correct blending can be achieved, if you require depth sorting then you'll need to segment up the cloth so it can be rendered from distant to near regions of the overall cloth. If the material is opaque then you want need to worry about depth sorting and could just render it as a single geometry.
For the placement of the vertices I would use a vertex shader with the flat geometry as input as well as various other parameter per vertex which are required to compute the final position, normals and texture coordinates. You could also encode some of this informative via textures that are read in the vertex shader. A fragment shader then could be used to get the most appropriate lighting model to render your cloth. Robert. On 23 July 2012 12:57, Werner Modenbach <werner.modenb...@texion.eu> wrote: > Hi Christian, > > thanks for the quick answer. > Actually I'm using both kind of self written shaders already and the > parallax displacement shader gives excellent results on yarn surface > calculation. > Also the problem is not just a displacement problem. > Imagine some shine through curtains. The lower end has many bows. This > means that the position of the vertexes has to be moved in 3D space. > Through the holes of the curtain you even see the backside of some other > part of the curtain. I know how to create a function for calculating the > positions of the moved vertexes but I don't know where to apply it. > unfortunately I see no possibility to implement this in shader code. > > Thaks for any further hints. > > - Werner - > > Am 23.07.2012 13:32, schrieb Christian Buchner: >> Hi, >> >> Programming vertex shaders is most likely what you want, as these >> allow you to modify your geometry "on the fly" to create a wavy >> appearance. If your mesh is rather coarse, you may either have to >> tesselate it finer, or you also have to add a pixel shading as well, >> e.g. for a per pixel displacement mapping. >> >> This gets complicated rather quickly, in particular the pixel shader >> part if you also want to get the lighting correctly done. >> >> Christian >> _______________________________________________ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > -- > TEXION Software Solutions, Rotter Bruch 26a, D-52068 Aachen > Phone: +49 241 475757-0 > Fax: +49 241 475757-29 > Web: http://texion.eu > eMail: i...@texion.eu > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org