Hello Carsten, the problem is that I need to know each SHLChunk in my scene tree. Imagine meshes are loaded and unloaded during runtime, I need to make sure that all appropriate SHLChunk instances get the appropriate update callback assigned. Therefore the idea was to make this as generic as possible, so the special shader parameters seemed to fit. Can you imagine another location where I could assign the system time, that gets syncronized even in cluster mode, so that each SHLChunk can fetch the correct value?
Thanks, Michael Am 10.02.2011 17:12, schrieb Carsten Neumann: > Hello Michael, > > On 02/10/2011 03:57 AM, Michael Raab wrote: >> we have the need to add a timer value to some shaders, that gets updated >> each frame. I was thinking about how this can be done without addtional >> overhead and found out that there are some special shader parameters like >> OSGWorldMatrix that get updated each frame automatically. >> In my opinion adding an additional special parameter like OSGSystemTime may >> do what we need. > why does it have to be one of the special parameters? Even if you need > it to be somewhat special, there is also SHLChunk::addParameterCallback > that allows you to make your own "special" parameters > >> The thing I'm not sure about is how the time value can be updated >> consistently for distributed rendering environments (clusters) as each >> interested shader on each render server/client should use the same time >> value to produce consistent results. >> Looking at the parameter update functions that are actually in the SHLChunk >> class, they seem to receive there current values mostly from current >> RenderAction State. As far as I understand in cluster environments the >> RenderAction will be unique on each host, so assigning a time value on the >> clients RenderAction will be not synced to render servers. >> Asking for local osg system time will return some system specific time that >> is most likely different on each client/server, correct? > yes. Also if you multiple parameters (special or not) they are updated > at different points in time so you'd not get a consistent value for the > system time either (at least not consistent for different shaders). > So the time value should probably be determined once by the application > and then passed to all interested shaders - that's the reason I'm > uncertain if a special parameter is the right way to go here. > >> Does anyone have an idea how to distribute the time value correctly to all >> interested SHLChunks? > hmm, the whole distribution problem goes away if you use a regular > parameter on the shader, those are distributed so you can set them on > the client and have all render servers produce the same image. > > Cheers, > Carsten > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > Opensg-users mailing list > Opensg-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/opensg-users > ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users