[osg-users] shader in OSG

2021-01-29 Thread 杨光
*I want to pass a two-dimensional array into the shader. Is this difficult to do? If this is not possible, in what form should this information be passed to the shader? Can this information be stored in a picture as a texture and passed to the shader, if so, how can the information in the textu

[osg-users] Shader Program stops working after Changing Viewer GraphcsContext or Viewer

2018-05-21 Thread Eran Cohen
Hi, I implemented a 'PausableViewer', to enable dynamically 'hiding' and 'showing' the window. I did it in the following way: On pause, I set done to true, create a new GraphicsContext with the same traits of the previous GraphicsContext, stop the viewer threading and switch them - Code: pause

Re: [osg-users] Shader composition with multiple function injection

2018-05-13 Thread Robert Osfield
Hi Hartwig, On 12 May 2018 at 22:59, Hartwig Wiesmann wrote: > In the example code one directional light computation can be injected. What > is the best solution if I like to inject 0 to N directional lights where N is > runtime dependent? > > I could do something like: > > Code: > > #ifdef L

[osg-users] Shader composition with multiple function injection

2018-05-12 Thread Hartwig Wiesmann
Hi, I had a look at the shader composition example. The main shader looks like this: Code: #pragma import_defines ( LIGHTING, TEXTURE_2D, VERTEX_FUNC(v) ) #ifdef LIGHTING // forward declare lighting computation, provided by lighting.vert shader void directionalLight( int lightNum, vec3 normal,

Re: [osg-users] shader

2017-04-06 Thread michael kapelko
Hi. Start with OpenSceneGraph beginner's guide: https://www.packtpub.com/game-development/openscenegraph-30-beginners-guide 2017-04-07 8:52 GMT+07:00 崔 献军 : > i have read opengl red bible and learnt some theory about it. next i want > to learn more, such as shader, osg, etc. > i was told shader i

[osg-users] shader

2017-04-06 Thread 崔 献军
i have read opengl red bible and learnt some theory about it. next i want to learn more, such as shader, osg, etc. i was told shader is important but osg was vrey little about shader, i have no other friends to ask how to do next. so, who can give any advice to learn osg? 崔献军 _

Re: [osg-users] Shader Update Latency?!

2017-02-11 Thread Johny Canes
Again, Okay this is definitely not a bug, but it seems quite a common pitfall to say the least. Instead of using viewer.frame(), which is a helper function that "calls advance(), eventTraversal(), updateTraversal(), renderingTraversals()" use the following. Code: viewer.advance(); viewer.ev

Re: [osg-users] Shader Update Latency?!

2017-02-11 Thread Johny Canes
Hi, This problem affects my shaders, since all my shaders rely on the correct view matrices. robertosfield wrote: > > By default the osgViewer::Viewer/CompositeViewer runs the update > traversal before the camera matrices are set, this is done as camera > manipulators might be tracking movemen

Re: [osg-users] Shader storage buffer object

2016-12-20 Thread Julien Valentin
Oups After few reading it comes to me that setting binding point in the glsl layout doesn't make mandatory to connect the Program But with my impl problem I'm good to debug my own stuff ... Sorry mp3butcher wrote: > Errh, ..don't understand... > I've just required a ssbo (for the purpose

Re: [osg-users] Shader storage buffer object

2016-12-20 Thread Julien Valentin
Errh, ..don't understand... I've just required a ssbo (for the purpose of summing stuff among threads). But when I look at the code SSBOBufferBinding and SSBO, there are nearly nothing :( to connect with the program. I don't know how the example make use of SSBO but my brain doesn't make any sen

Re: [osg-users] Shader, OpenGL context and Qt

2016-09-20 Thread Valerian Merkling
Hi, After a few more days of search, I can resume my problem in a more simple way : I've a set of osg::Program. Each Widgets has its own contextID, and contextID can be re-used. The first time I load the osg::Program "my_program1" on a view with a contextID of 1, it's ok. If then I load "my_p

Re: [osg-users] Shader, OpenGL context and Qt

2016-09-16 Thread Valerian Merkling
Hi, I'm still stuck with my shaders problem and I ran out of ideas, but I have new elements, and a new question. My shader works on the first view, so this code is ok (ie thoses two shaders works fine) : Code: osg::ref_ptr vertex=new osg::Shader(osg::Shader::Type::VERTEX, vertex_source); os

[osg-users] Shader, OpenGL context and Qt

2016-09-12 Thread Valerian Merkling
Hi, I'm working on a GIS app based on Qt and OpenGL, and I'm replacing all OpenGL calls with OSG 3.4.0. I can display multiples views. Each view is independant, hold in QGLWidets, got only one camera and its own scenegraph, and a new instances of osg::Program and osg::Shader (no osg objects sh

Re: [osg-users] shader composition

2015-01-29 Thread Trajce Nikolov NICK
Thanks Robert, Robert, I will wait for the new code then. Nick On Thu, Jan 29, 2015 at 11:54 AM, Robert Milharcic < robert.milhar...@ib-caddy.si> wrote: > On 29.1.2015 0:23, Trajce Nikolov NICK wrote: > >> I read the shader composition code and the used classes - which are really >> without any

Re: [osg-users] shader composition

2015-01-29 Thread Robert Milharcic
On 29.1.2015 0:23, Trajce Nikolov NICK wrote: I read the shader composition code and the used classes - which are really without any documentation:-). Can someone give a fast intro into this, the sample for example? Thanks a bunch as always Hi Nick, I once did some experimental coding on shad

Re: [osg-users] shader composition

2015-01-29 Thread Robert Osfield
Hi Nick, On 28 January 2015 at 23:23, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > > I read the shader composition code and the used classes - which are really > without any documentation :-). Can someone give a fast intro into this, the > sample for example? > ShaderComposition

[osg-users] shader composition

2015-01-28 Thread Trajce Nikolov NICK
Hi Community, I read the shader composition code and the used classes - which are really without any documentation :-). Can someone give a fast intro into this, the sample for example? Thanks a bunch as always Nick -- trajce nikolov nick ___ osg-user

Re: [osg-users] Shader storage buffer object

2014-12-10 Thread Markus Hein
Hello Robert, Thanks for the changes to work with svn/trunk. I've been able to slot them into svn/trunk pretty easily, everything compiles and runs on my system. I don't know yet whether I see exactly what I should be expecting - a group of points that start in a cube then swirl outwards, p

Re: [osg-users] Shader storage buffer object

2014-12-10 Thread Robert Osfield
Hi Markus, Thanks for the changes to work with svn/trunk. I've been able to slot them into svn/trunk pretty easily, everything compiles and runs on my system. I don't know yet whether I see exactly what I should be expecting - a group of points that start in a cube then swirl outwards, particula

Re: [osg-users] Shader storage buffer object

2014-12-04 Thread Robert Osfield
Hi Markus, On 4 December 2014 at 15:05, Markus Hein wrote: > Really needed for SSBO/SSBB support is probably only 50% of the changes I > have made to my osg-core sources. And it is mostly not changing existing > osg, just new stuff, added to existing source. I only know about one > changed osg

Re: [osg-users] Shader storage buffer object

2014-12-04 Thread Markus Hein
Hi Robert, To help with my work could you port your work to svn/trunk and let me know which bits you feel should be merged first/what would help this effort. yes, I see that you will need the changes based on latest trunk, and not based on release 3.2.1. Unfortunately I can't start doing thi

Re: [osg-users] Shader storage buffer object

2014-12-04 Thread Robert Osfield
Hi Markus, I have just done a quick first pass review against svn/trunk and there are lots of changes between 3.2.1 and svn/trunk that result in so many differences that it's difficult to spot all the extension specific changes. I will next look at the changes between your submission and 3.2.1 bu

Re: [osg-users] Shader storage buffer object

2014-12-03 Thread Julien Valentin
Markus Hein wrote: > Hello Julien, > hmm, FeedbackTransformBuffers can be used for this, somehow . > > I think that SSBO's and the very latest GL features making sense if > thinking about changing the app design/architecture . > Well It's my opinion, but a lot of new GL4 features make me

Re: [osg-users] Shader storage buffer object

2014-12-03 Thread Markus Hein
Hello Julien, Den 03.12.2014 22:27, skrev Julien Valentin: Hello all Just by curiosity, I wonder what concrete usage make mandatory the SSBO..? in your scenerio : particle advection doesn't require R/W RAM buffer, ping pong feedback streams are designed for this...(haven't compare perfs but sea

Re: [osg-users] Shader storage buffer object

2014-12-03 Thread Julien Valentin
Hello all Just by curiosity, I wonder what concrete usage make mandatory the SSBO..? in your scenerio : particle advection doesn't require R/W RAM buffer, ping pong feedback streams are designed for this...(haven't compare perfs but seams obvious) bye -- Read this topic online

Re: [osg-users] Shader storage buffer object

2014-12-02 Thread Steven Powers
I'm actively working on this as well. Could you send me the zip file so that I can try it out? Cheers, Steven -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61950#61950 ___ osg-users mailing list os

Re: [osg-users] Shader storage buffer object

2014-11-20 Thread Robert Osfield
Hi Marcus, On 19 November 2014 21:32, Markus Hein wrote: > I'm still sitting here with making an osgexample app for SSBO's but > basically it is working as expected under a modified osg-3.2.1. I have > attached some screenshots, showing number of 512x512 particles computed > and rendered usin

Re: [osg-users] Shader storage buffer object

2014-11-18 Thread Markus Hein
Hi, regarding SSBO and OSG , I will try to contibute by adding my changeset later the day or tomorrow for comparison, review and test. From what I have seen until now, it is important to implement and use glMemoryBarrier() properly , avoiding sync issues when rendering data stored in SSBO

Re: [osg-users] Shader storage buffer object

2014-11-18 Thread Sverre Aleksandersen
haha thanks I've already walked 30 minutes today :) Thanks for the tip - will post here when and if I get something working On Tue, Nov 18, 2014 at 2:51 PM, Robert Osfield wrote: > Hi Sverre, > > On 18 November 2014 12:37, Sverre Aleksandersen < > sverre.aleksander...@gmail.com> wrote: > >> I'v

Re: [osg-users] Shader storage buffer object

2014-11-18 Thread Robert Osfield
Hi Sverre, On 18 November 2014 12:37, Sverre Aleksandersen < sverre.aleksander...@gmail.com> wrote: > I've added support for SSBO, but haven't finished glMemoryBarrier yet. > > I've looked at this ( > https://github.com/openscenegraph/osg/commit/160a7a5c674615a4119b6022e31d7e4cdcb84f7e) > commit

Re: [osg-users] Shader storage buffer object

2014-11-18 Thread Sverre Aleksandersen
Allright thanks. I've added support for SSBO, but haven't finished glMemoryBarrier yet. I've looked at this ( https://github.com/openscenegraph/osg/commit/160a7a5c674615a4119b6022e31d7e4cdcb84f7e) commit which added support for compute shaders. I don't really understand why the functionality is s

Re: [osg-users] Shader storage buffer object

2014-11-18 Thread Robert Osfield
HI Sverre, The OSG-3.2 predates the shader storage buffer object extension so won't be support. The OSG-trunk doesn't yet have support either, but it might be possible to add prior to creating the OSG-3.4 branch - and you'd be welcome to have a bash. Looking at the OpenGL extension specs: https

[osg-users] Shader storage buffer object

2014-11-17 Thread Sverre Aleksandersen
Hi, I'm wondering whether shader storage buffer objects are available in OSG. So far I've only looked at OSG 3.2.1. As far as I can tell this buffer object is not available in this version, please correct me if I'm wrong. Is there any plans in implementing it? If not, I might be interested in gi

Re: [osg-users] Shader Problems, AMD is Fine, NVIDIA is not

2014-06-17 Thread Fitz Chivalrik
Hi SMesserschmidt, many thanks for your answer! It really helps for a newbie like me if he reads the confirmation, that it is not related to his OSG Code but to Shader. I was struggling with this a whole week and did not know where to look. I did not initialized the vec4 color var in my method,

Re: [osg-users] Shader Problems, AMD is Fine, NVIDIA is not

2014-06-16 Thread Sebastian Messerschmidt
Hi Fitz, Hi, seems like it was part of the problem, but not all of it. Intel HD4400 and my AMD Cards still work fine, but the Quadro 600 is missing all light it seems, it s much darker then it shoud be, it seems like not all lights are used. Furthermore, trying to get the shader work on the G

Re: [osg-users] Shader Problems, AMD is Fine, NVIDIA is not

2014-06-16 Thread Fitz Chivalrik
Hi, seems like it was part of the problem, but not all of it. Intel HD4400 and my AMD Cards still work fine, but the Quadro 600 is missing all light it seems, it s much darker then it shoud be, it seems like not all lights are used. Furthermore, trying to get the shader work on the GTX 660 TI or

Re: [osg-users] Shader Problems, AMD is Fine, NVIDIA is not

2014-06-14 Thread Fitz Chivalrik
Okay, after hours after hours of debugging and research only pure luck gave me the final hint: Non-uniform flow control and, as a result, undefined behavior. Apperantly one cannot access texture coordinates savely, if the point of access in the code is not uniform, e.g. after an if-statement, whi

[osg-users] Shader Problems, AMD is Fine, NIVIDA is not

2014-06-14 Thread Fitz Chivalrik
Hi, currently I am working on a OSG Project as part of my study. I wrote a Toon Shader and a Fog Shader (as Post-Process), which work fine on my (and others) AMD Graphic Cards. However, on almost every NVIDIA Card (the only one it worked very slow was a Quadro one, unfortunately I do not know w

Re: [osg-users] Shader composer and position state

2013-09-04 Thread Robert Milharcic
On 4.9.2013 15:39, Robert Osfield wrote: Hi Robert, When implementing the osg::ShaderComposer functionality I had in mind that ability to have a custom StateAttribute/ShaderAttribute::apply() compute the view dependent uniform state and apply this to the osg::State. The apply() method would get

Re: [osg-users] Shader composer and position state

2013-09-04 Thread Robert Osfield
Hi Robert, When implementing the osg::ShaderComposer functionality I had in mind that ability to have a custom StateAttribute/ShaderAttribute::apply() compute the view dependent uniform state and apply this to the osg::State. The apply() method would get the modelview matrix from the osg::State a

[osg-users] Shader composer and position state

2013-09-04 Thread Robert Milharcic
Hi all, My goal is to replace shader generator with shader composer, so I spent a few days playing with it. It proved to be very flexible and powerful tool but unfortunately, it lacks the support for a key feature I would consider necessary, and that is support for the "position state". Putti

Re: [osg-users] shader composing related link

2013-08-05 Thread Robert Milharcic
On 5.8.2013 15:23, Sergey Kurdakov wrote: en sourced so maybe it might be of some interest to look at. Best regards Sergey Very Interesting indeed. One more thing is needed though, the osg implementation of the nvFX interfaces (currently implemented for GL, D3D, CUDA and OPTIX) . On the other

[osg-users] shader composing related link

2013-08-05 Thread Sergey Kurdakov
Hi All, just to share, searching for shader composing stumbled across https://github.com/tlorach/nvFX https://developer.nvidia.com/sites/default/files/akamai/gamedev/docs/nvFX%20A%20New%20Shader-Effect%20Framework.pdf it is open sourced so maybe it might be of some interest to look at. Best r

Re: [osg-users] Shader reloading

2012-09-24 Thread Sergey Polischuk
Hi, Christian Can't help you with crash, but i think you can find this usefull: 1) noise functions for glsl not implemented in hardware\drivers of most vendors, so dont even bother to use them. 2) why do you ever need to recreate program and all that stuff, if all you need is to change randomUni

[osg-users] Shader reloading

2012-09-24 Thread Christian Rumpf
hello! I'm trying to simulate noise effects in real time using OSG and GLSL. I rendered to texture a scene to get a sampler2D. Mu and Sigma for noise simulation are static. My idea is to reload fragment shader in a while loop with a random number as uniform because GLSL's noise() function doesn

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-21 Thread Ethan Fahy
Gotcha, thanks. No need for apologies, I never would have got as far as I did to begin with if it weren't for that post. Thanks again everyone for the assistance on this one, I have the LUT method working perfectly now with floating point values. Jean-Sébastien Guay wrote: > Hi Ethan, > >

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-21 Thread Jean-Sébastien Guay
Hi Ethan, Thanks Sergey, that clears it up for me. Yes, Sergey has it right, that post was written from memory and obviously I got it backwards. I always cast the variable to int, or explicitly create a uniform of type SAMPLER_2D which avoids this issue altogether but is more lines of code.

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-21 Thread Ethan Fahy
Thanks Sergey, that clears it up for me. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45643#45643 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listin

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-21 Thread Sergey Polischuk
From opengl docs: glUniform1i and glUniform1iv are the only two functions that may be used to load uniform variables defined as sampler types. Loading samplers with any other function will result in a GL_INVALID_OPERATION error. And osg uses this calls only for int uniforms or sampler uniforms, f

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-21 Thread Ethan Fahy
By the way I had originally put the TEXTURE_UNIT as a const unsigned int because of the 10th post in this thread: http://forum.openscenegraph.org/viewtopic.php?t=8273 as it was suggested by Jean-Sebastien. Not sure if there is some disconnect that I am still not getting but changing it to a regu

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-21 Thread Ethan Fahy
Jean-Sebastien and Sergey, Thanks very much to you both. Sergey, you were spot-on about the unsigned int vs int thing causing my OpenGL error and Jean-Sebastien you were correct about the texture clamping default. -- Read this topic online here: http://forum.openscenegraph.org/

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-20 Thread Sergey Polischuk
Hi there I dont read all messages here, but if problem still there - your uniform for sampler initialized wrong You should use state->addUniform(new osg::Uniform("lut", int(TEXTURE_UNIT))); notice int cast there or you should create uniform with explicit type specification of osg::Uniform::INT,

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-17 Thread Jean-Sébastien Guay
Hello Ethan, Is a border being added to my texture somehow? If so then this could explain why my shader is pulling non-uniform values from my uniform lookup table texture... Set the wrap mode to CLAMP_TO_EDGE instead of CLAMP_TO_BORDER (which is the default, and the default border color is

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-17 Thread Ethan Fahy
I tried setting the texture that I created to texture unit = 0 and found that the resultant object in osgviewer was unchanged from its original texture. I'm not if this means that I have created my texture incorrectly or if the texture attachment process is not correct. apecoraro wrote: > I h

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-17 Thread Alex Pecoraro
I honestly don't know why it doesn't work. Your code looks correct to me. You might try removing the shader and setting your lut to use texture unit 0 on your terrain node. Then you can at least verify that the texture is created correct by viewing it on the terrain using the fixed function pipe

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-17 Thread Ethan Fahy
Thanks for the reply Alex. I tried those changes (I think I've tried just about every pixel/internal format that I could think of) and the behavior of my program hasn't changed unfortunately. apecoraro wrote: > I think the internal format of your osg::Image should be set to GL_RGBA8 not > G

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-17 Thread Alex Pecoraro
I think the internal format of your osg::Image should be set to GL_RGBA8 not GL_RGBA, which is a pixel format not an internal format. I find the OpenGL 2.1 documentation very confusing on the use of internal format and pixel format, but I think the 3.3 and 4.2 documentation is much easier to und

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-17 Thread Ethan Fahy
Thanks for the reply Alex. My setup is exactly as you describe but I'm still having troubles. I've taken the essential bits of my code to create a sample main() to illustrate exactly what I'm doing: Code: int main(int argc, char* argv[]) { //INITIAL SETUP //create root

Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-16 Thread Alex Pecoraro
Hi Ethan, All you should need to do is attach your osg::Texture to the osg::Stateset that you are attaching your osg::Program to and then you also need to add an osg::Uniform to the Stateset for the texture sampler that you use in your shader program to access the texture: Code: osg::ref_ptr

[osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-16 Thread Ethan Fahy
Hi all, I'm having some difficulty setting up a GLSL lookup table shader with my osg program and am hoping for some help. I've looked at every opengl, glsl, osg and other forum posting I could find online and think I am pretty close to getting things working. I could put a ton of code here bu

Re: [osg-users] Shader that can calculate pixel depth in meters

2012-01-04 Thread Paul Martz
Your issue is a relatively straightforward linear algebra problem. If you didn't pick up this skill set in grade school or a university-level course, It's unlikely someone will teach you linear algebra on this mail list. (Not trying to sound like a know-it-all; it's simply a fact that software d

Re: [osg-users] Shader that can calculate pixel depth in meters

2012-01-04 Thread Ethan Fahy
Thanks GMan for the reply and the source code, much appreciated. I was able to tweak your shaders for my needs and I think I am off to a good start. However I'm still not sure exactly what coordinate system I'm dealing with. In my case, I have an osg terrain loaded in in geocentric coordinate

Re: [osg-users] Shader that can calculate pixel depth in meters

2012-01-03 Thread Michael Guerrero
Hi Ethan, I did this a little while back using information from that page as well. I'm guessing "real" depth here just means that it's in whatever units you've modeled your world in. For instance, if the near plane is at 1.0, what are the units of 1.0? My purpose was to make sure that clouds f

[osg-users] Shader that can calculate pixel depth in meters

2011-12-30 Thread Ethan Fahy
I need to write a GLSL shader that will be able to calculate the distance between the camera and the object being rendered by each pixel. The catch is that I need those distances to be linear and they need to be in meters, reflecting the real geometry of my scene. There are a number of guides

[osg-users] Shader question

2011-12-22 Thread Werner Modenbach
High all, I'm using LightSpacePerspectiveShadowMapCB in my project and I am quite satisfied by the results. Now I'd like to extend the features of the shaders by bump mapping and hopefully displacement mapping. So I have to add some additional code to the shaders coming from SoftShadowMap. Has

[osg-users] Shader and attributes binding

2011-11-12 Thread Aurelien Albert
Hi, I'm writing some shaders to use with OSG and some use extra vertex attribute (such as tangent for a bump shader) I think the OpenGL way of vertex attribute binding is : - compile and link the shader program - get the attribute location by calling glGetAttribLocationARB(program, "attributeN

Re: [osg-users] Shader Composition

2011-09-14 Thread Robert Osfield
Hi Bo, ShaderComposer isn't complete, and should be viewed as experimental, but it's able to do a few composition tasks. The osgshadercomposition example is a test bed for this feature, unfortunately I've been swamped with other work so haven't been able to complete the work on ShaderComposition

[osg-users] Shader Composition

2011-09-13 Thread Bo Jiang
Hi All, I have a node, and I want to shade it using different effect, i.e. I have several groups of shaders (vertex+geometry+fragment), and each group implements one effect. Now I want to combine all the effects together when display the node. I do not know how to achieve it. I searched the fo

Re: [osg-users] Shader Update Latency?!

2011-01-12 Thread Robert Osfield
Hi Guo, On Wed, Jan 12, 2011 at 7:04 AM, Guo Chow wrote: > I encounter a similar latency problem when I try to update a uniform using > camera's view matrix in the uniform's callback. Since this uniform is needed > to compute only once per frame, I decide to compute it on CPU before it's > submit

Re: [osg-users] Shader Update Latency?!

2011-01-11 Thread Guo Chow
Robert Osfield writes: > > Hi Thorsten, > > By default the OSG computes the near/far planes on the fly during the > cull traversal on every single frame. You can disable this. > Alternatively you could just use the gl_ProjectionMatrix directly on > the GPU to get the near/far planes - this is

Re: [osg-users] Shader problem on nvidia card

2010-12-22 Thread Robert Osfield
Hi Aitor, The warning you are getting "OpenGL version test failed, requires valid graphics context." suggests that you are trying to do rendering from a thread that doesn't have a graphics context current. I know nothing about how you are setting up your graphics context or how you manage you fra

[osg-users] Shader problem on nvidia card

2010-12-22 Thread Aitor Ardanza
Hi, I have a problem when I apply a shader to an object in osg. I tried it on two machines. One with an intel G41 graphics card, which does not give me any problem, and the other is a NVidia GTX 480, which gives me the problem. When osg try to compile the shader, skip the following error: FRAG

Re: [osg-users] Shader Update Latency?!

2010-12-01 Thread Thorsten Roth
Hi Robert, thank you for this information. I did not know that I could do this, as I'm an absolute newbie concerning shader stuff and was happy that I just got it to work somehow ;) I will try the approach with gl_ProjectionMatrix tomorrow, thank you :) -Thorsten Am 01.12.2010 20:51, schrie

Re: [osg-users] Shader Update Latency?!

2010-12-01 Thread Robert Osfield
Hi Thorsten, By default the OSG computes the near/far planes on the fly during the cull traversal on every single frame. You can disable this. Alternatively you could just use the gl_ProjectionMatrix directly on the GPU to get the near/far planes - this is how I'd do it, far more flexible and nev

Re: [osg-users] Shader Update Latency?!

2010-12-01 Thread Thorsten Roth
I have actually tried it now, but it made no difference :-( -Thorsten Am 01.12.2010 19:22, schrieb Tim Moore: Have you set the data variance of the Uniform object -- and the containing StateSet object -- to Object::DYNAMIC? Tim On Wed, Dec 1, 2010 at 7:15 PM, Thorsten Roth mailto:thorsten.r..

Re: [osg-users] Shader Update Latency?!

2010-12-01 Thread Tim Moore
Have you set the data variance of the Uniform object -- and the containing StateSet object -- to Object::DYNAMIC? Tim On Wed, Dec 1, 2010 at 7:15 PM, Thorsten Roth wrote: > Hi, > > I currently have a problem with a shader update callback I do not > understand. I have a vertex and fragment shader

[osg-users] Shader Update Latency?!

2010-12-01 Thread Thorsten Roth
Hi, I currently have a problem with a shader update callback I do not understand. I have a vertex and fragment shader which calculate linear depth in [0,1] for me, also respecting dynamic clipping planes. To achieve this, I pass zNear and zFar as uniform parameters to the shader. To have them

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-07-02 Thread Robert Osfield
Hi All, I've started doing a preliminary implementation the of the design I discussed in previous emails. I've introduced ShaderComponent and now StateAttribute "has a" optional ShaderComponent. I've also fleshed out a bit more of ShaderComposer with some very simple wiring in osg::State to inv

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-07-01 Thread Robert Osfield
Hi Brad, On Thu, Jul 1, 2010 at 11:18 AM, Christiansen, Brad wrote: > One thing I am not clear on is how the rules for injecting a Shader into a > ShaderMain would work. This is an area I have had difficulty with in my own > shader assembly approach. For example, how will it be possible to chan

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-07-01 Thread Christiansen, Brad
Brad -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Thursday, 1 July 2010 4:30 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Shader composition, OpenGL modes and custom modes Hi All,

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-07-01 Thread Robert Osfield
Hi All, I've been thinking about the various classes and relationships that we'll need to support both the front end API for shader composition, and the backend implementation of it, and my current thoughts are: 1) The ShaderSet I've been discussing over my last few post should be renamed, my

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-30 Thread Christiansen, Brad
2010 5:05 PM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Shader composition, OpenGL modes and custom modes Hi Roland, On Tue, Jun 29, 2010 at 10:22 PM, Roland Smeenk wrote: >> 1) Provide a way of encapsulating all the details required to >> contribute a single ch

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-30 Thread Robert Osfield
Hi Adrian, I don't think we need worry about high level algorithms with shader composition, they should all just work fine. My expectation is that only the fine grained management of state needs to tackled with shader composition, the coarsed grained RenderBin/RenderStage multi-pass techniques wi

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-30 Thread Adrian Egli OpenSceneGraph (3D)
Hi Robert, hi others, I am currently working on image processing pipelines based on GLSL shaders. Currently we have many different special effects (shaders) but all of them work encapsulated. May we should also think on other topic while overwork the shader composite idea. i review the osgvirtualp

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-30 Thread Robert Osfield
Hi Roland, On Tue, Jun 29, 2010 at 10:22 PM, Roland Smeenk wrote: >> 1) Provide a way of encapsulating all the details required to >> contribute a single chunk of functionality that will be combined with other >> active ShaderSet to provide final composed osg::Program. > > Isn't this what I solv

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-30 Thread Robert Osfield
Hi Bruce, On Tue, Jun 29, 2010 at 5:41 PM, Bruce Wheaton wrote: > One is that GLSL is quite poor for initialization. The main problem with this > is if you were to enable a shader with, say, 8 uniforms, there wasn't, until > very recently, a way to initialize them, and the stateset enable calls

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-29 Thread Roland Smeenk
Hi Robert and others, unfortunately I am experiencing some stressfull time at work which does not really allow me to contribute to this thread as much as I would like to. I am trying to keep up with the posts, but not all posts are clear to me. robertosfield wrote: > > 1) Provide a way of enc

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-29 Thread Bruce Wheaton
> Very excited about the new features Robert, sounds like you're really cracking on. I had two thoughts I hope you'll consider integrating: One is that GLSL is quite poor for initialization. The main problem with this is if you were to enable a shader with, say, 8 uniforms, there wasn't, until

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-29 Thread Mathias Fröhlich
Hi Robert, On Tuesday 29 June 2010, Robert Osfield wrote: > I believe we'll all be in agreement here. This is certainly what I'm > aiming for, all the designs I'm working on use a program cache as a > fundamental part of the design, with state changes minimized. I don't > see it all as much dif

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-29 Thread Robert Osfield
I've not at the computer full time for the last couple of days so haven't been able to push the shader composition implementation on yet. Design wise I've been doing bits here and there. My latest thought is that we probably need to encapsulate the component that will go to make up shader composi

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-29 Thread Robert Osfield
Hi Mathias, 2010/6/29 Mathias Fröhlich : > So, what I think is that we need minimize shader compilation as well as shader > *linking* as much as possible. If the implementation you have in mind really > does this, then fine. If you intent to relink on about every > StateAttribute::compose(osg::St

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-29 Thread Mathias Fröhlich
Hi Robert, On Monday 28 June 2010, Robert Osfield wrote: > Yes, even if we tweak the API a bit in StateSet any new elements will > sorted virtue of being in StateSet. Whatever we do StateSet's will > remain the container for all things state in the scene graph, and the > what basis of coarsed gr

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-28 Thread Robert Osfield
Hi Mathias, 2010/6/28 Mathias Fröhlich : > So, ok, we will get state sorting for the fixed function pipline state > attributes because of these being traditionally sorted in the state graph. > Ok, and the additional non fixed function shader snipets will be sorted > because of being such state att

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-28 Thread Robert Osfield
Hi Tim, On Sat, Jun 26, 2010 at 6:05 PM, Tim Moore wrote: > OK, so the "shader generation" or fixed function emulation provides more > shaders that might be linked or combined by "shader composition," and the > "shader candidate functions" are controlled by existing OSG state > attributes? Our t

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-28 Thread Mathias Fröhlich
Hi Robert, On Saturday 26 June 2010, Robert Osfield wrote: > The plan I have wouldn't affect state sorting, and lazy state updating > of the composed shader programs would be utilized, and caching of the > composed shader programs would be used once it has been composed. > Only when you change mo

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-26 Thread Tim Moore
On Sat, Jun 26, 2010 at 12:30 PM, Robert Osfield wrote: > Hi Tim, > > On Fri, Jun 25, 2010 at 8:37 AM, Tim Moore wrote: > > Is it fair to say that the major interest in shader generation is in > porting > > existing OSG apps to OpenGL ES 2.0, which doesn't have any fixed > pipeline? > > I wouldn'

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-26 Thread Robert Osfield
Hi Tim, On Fri, Jun 25, 2010 at 8:37 AM, Tim Moore wrote: > Is it fair to say that the major interest in shader generation is in porting > existing OSG apps to OpenGL ES 2.0, which doesn't have any fixed pipeline? I wouldn't agree with this statement. It's not about GLES 2.0 and it's not about

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-26 Thread Robert Osfield
Hi Johannes, I don't believe VirtualProgram is sufficiently sophisticated for our purposes, I agree about linking existing osg::Shader rather than composing these on the fly like in Roland's implementation. However we still have to inject code into the main for each of the vertex, geometry and fr

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-26 Thread Robert Osfield
Hi Mathias, 2010/6/25 Mathias Fröhlich : > With that proposal - espcially the StateAttribute::compose call working > directly on the osg::State - I conclude that we need to relink during draw: > * we will probably loose state sorting for the shader combinations > * shaders need to be at least reli

Re: [osg-users] Shader composition, OpenGL modes and custom modes

2010-06-25 Thread Bruce Wheaton
On Jun 25, 2010, at 6:42 AM, Mathias Fröhlich wrote: > With that proposal - espcially the StateAttribute::compose call working > directly on the osg::State - I conclude that we need to relink during draw: > * we will probably loose state sorting for the shader combinations > * shaders need to be

  1   2   >