Re: [osg-users] GLSL and OSG
FYI: if you search the OSG mail archives the reasons have been discussed in detail before this Gordon Product Manager 3d __ Gordon Tomlinson Email : gtomlinson @ overwatch.textron.com __ -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ulrich Hertlein Sent: Friday, June 26, 2009 11:43 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] GLSL and OSG On 26/6/09 4:39 PM, Maxime BOUCHER wrote: > Just a question of curiosity. > > I can guess Z and Y defaults haven't been change just for fun neither the vector column/row. > But I wonder which are these reasons. The Z-up is popular in the vis-sim industry as it feels more natural to assume X-east, Y-north, Z-up. But it's not hard-coded or anything, just the default. You can change it without problems by specifying an up vector of osg::Vec3(0,1,0). Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GLSL and OSG
On 26/6/09 4:39 PM, Maxime BOUCHER wrote: Just a question of curiosity. I can guess Z and Y defaults haven't been change just for fun neither the vector column/row. But I wonder which are these reasons. The Z-up is popular in the vis-sim industry as it feels more natural to assume X-east, Y-north, Z-up. But it's not hard-coded or anything, just the default. You can change it without problems by specifying an up vector of osg::Vec3(0,1,0). Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GLSL and OSG
Just a question of curiosity. I can guess Z and Y defaults haven't been change just for fun neither the vector column/row. But I wonder which are these reasons. Does someone know about it? Thanks, Max -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14598#14598 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GLSL and OSG
Alright, thanks. Max -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14596#14596 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GLSL and OSG
Hi Maxime, On 26/6/09 2:44 PM, Maxime BOUCHER wrote: 2) More problematic. Y and Z axis are swapped between OSG and OpenGL. Thus do I have to do a sort of swap between dimensions (so to say) ? For example, I have a camera with view and projection, in osg conventions, and I use the viewmatrix in the shader. That's why I wonder. They aren't swapped. OSG is using the same right-handed coordinate system as OpenGL, the only difference being that OSG by default uses Z-up whereas OpenGL uses Y-up by default. There's no need to swap anything, it's just a matter of camera positioning/world layout. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] GLSL and OSG
Hi, I am new in GLSL, and all OpenGL GLSL examples I saw needed a heavy "preparation", whereas in OSG it's really nice. Thanks a lot and congratulations! As always I have a few questions. 1) OSG considers vectors as lines, OpenGL as columns. Thus every matrix/vector mutltiplication have to be transposed. It seems to me, but I'm not really sure, when I pass an OSG matrix in my shader, it is automatically transposed. Am I right? 2) More problematic. Y and Z axis are swapped between OSG and OpenGL. Thus do I have to do a sort of swap between dimensions (so to say) ? For example, I have a camera with view and projection, in osg conventions, and I use the viewmatrix in the shader. That's why I wonder. 3) Since I'm here, let's ask one more thing. Does any of you know if it is possible to debug shader in Visual Studio using glsldevil ? (I just opened it and loaded the vcproj, of course, it didn't work). Thank you a lot! Cheers, Max -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14585#14585 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org