Yeah, work well now. Thanks !!!

Nick

On Mon, Dec 1, 2014 at 9:45 AM, Trajce Nikolov NICK <
trajce.nikolov.n...@gmail.com> wrote:

> Thanks Sebastian.I could of thought of this. Let me give  it a shot.
> Thanks again!
>
> Nick
>
> On Mon, Dec 1, 2014 at 9:26 AM, Sebastian Messerschmidt <
> sebastian.messerschm...@gmx.de> wrote:
>
>>  Hi Nick,
>>
>> One way to improve this is to place your "root" somewhere near the center
>> of your instanced geometry and subtract the center from your instances
>> positions.
>> This way the coordinates to be multiplied stay small in relation (as the
>> big precision loss due to View*Model is done on the CPU side (during cull)
>> instead of multiplying big coordinates one the GPU with the inverse.
>> So decorate your CustomGeometry subgraph with a transform and modify your
>> instances position accordingly.
>>
>> Hi Community,
>>
>>  me again on this. I have it working, however, it looks really bad when
>> using large coordinates (when placed on UTM or Geocentric). The model is
>> somewhat distorted due to precission issues. I know how to avoid this, like
>> working with double matrices, but when I pass double matrix on the vertex
>> shader it kills the performance - from 60Fps to ~1 fps. Bellow is the
>> vertex shader. Any hints?
>>
>>  Thanks a bunch as always
>>
>>  #version 150 compatibility
>>
>>  uniform mat4 osg_ModelViewProjectionMatrix;
>> uniform mat3 osg_NormalMatrix;
>> uniform vec3 lightDirection;
>>
>>  in vec3 vPosition;
>> in vec3 vNormal;
>> in vec2 vTexCoord;
>> in mat4 vInstanceModelMatrix;
>>
>>  smooth out vec2 texCoord;
>> smooth out vec3 normal;
>> smooth out vec3 lightDir;
>>
>>  void main()
>> {
>>  gl_Position = /*osg_ModelViewProjectionMatrix*/
>> gl_ModelViewProjectionMatrix * vInstanceModelMatrix * vec4(vPosition, 1.0);
>>  texCoord = vTexCoord;
>>
>>  mat3 instanceNormalMatrix = mat3(vInstanceModelMatrix[0][0],
>> vInstanceModelMatrix[0][1], vInstanceModelMatrix[0][2],
>>  vInstanceModelMatrix[1][0], vInstanceModelMatrix[1][1],
>> vInstanceModelMatrix[1][2],
>>  vInstanceModelMatrix[2][0], vInstanceModelMatrix[2][1],
>> vInstanceModelMatrix[2][2]);
>>
>>  normal = osg_NormalMatrix * instanceNormalMatrix * vNormal;
>>  lightDir = lightDirection;
>> }
>>
>> On Tue, Nov 25, 2014 at 12:06 PM, Robert Osfield <
>> robert.osfi...@gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> On 24 November 2014 at 09:28, Sebastian Messerschmidt <
>>> sebastian.messerschm...@gmx.de> wrote:
>>>
>>>>  The example I was looking for was in the submissions, called:
>>>>
>>>> [osg-submissions] New example : culling and LODing performed on GPU side
>>>>
>>>> Unfortunately Robert didn't approve or merge the nescessary changes.
>>>> Maybe it went unnoticed.
>>>>
>>>
>>>  I am still progressing through the submissions backlog and am
>>> delighted to say that this wee gem of an example is now checked into
>>> svn/trunk - look for osggpucull.  I haven't had a chance to spend the time
>>> understanding it yet, but the code is there.
>>>
>>> Robert.
>>>
>>>
>>> _______________________________________________
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>>>
>>
>>
>>  --
>> trajce nikolov nick
>>
>>
>> _______________________________________________
>> osg-users mailing 
>> listosg-users@lists.openscenegraph.orghttp://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
>>
>>
>
>
> --
> trajce nikolov nick
>



-- 
trajce nikolov nick
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to