Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] Re: Re: Re: Re: transactions in manta - setting camera


Chronological Thread 
  • From: Roni Choudhury < >
  • To:
  • Subject: [Manta] Re: Re: Re: Re: transactions in manta - setting camera
  • Date: Tue, 09 Dec 2008 16:01:50 -0700

Well I think Dav's point is just that there should be a warning for users when they go to do this. If my pie-in-the-sky idea were implemented (assuming it's even possible/feasible) then code where you were doing transaction-type things outside of transactions just wouldn't compile, which would save a lot of time for the developer. Dav's idea would just force the warning on you as you code (also saving time).

roni

Carson Brownlee wrote:
I think in general any state changes aren't thread safe and should be done outside the rendering loop. This includes changes to cameras, materials, etc. You would need to add notThreadSafe() to just about everything. In most scenes all of the state data will be setup in make_scene, before going into a render loop. For changing things while in the rendering loop transactions should often be used. I think it makes sense, though it can be a pain making transactions for everything I suppose.
Carson


On Dec 9, 2008, at 3:43 PM, J. Davison de St. Germain wrote:

Why does setBasicCameraData() exist (or at least why is it visible) if it 'really' shouldn't be used? If it is necessary, perhaps it should be renamed to "setBasicCameraData_notThreadSafe()" or some such?

 Thanks,
       Dav

Carson Brownlee wrote:
the difference is that the transaction will be called when manta isn't rendering. the transaction is "safer" incase you have a shader that is referencing camera data in parallel to the gui code setting it. This is unlikely but possible, all calls like that should be done in a transaction. It wouldn't be a major loss in this case though as memory isn't being remapped, I don't think setBasicCameraData deletes the old cameraData.
Carson


On Dec 9, 2008, at 3:37 PM, J. Davison de St. Germain wrote:

Hi,

What is the difference between:

 data = manta_new(BasicCameraData(eye,lookat,up,fov,fov))
 engine.getCamera(0).setBasicCameraData(data)

And creating a transaction to do the same thing?

 Thanks,
       Dav





Archive powered by MHonArc 2.6.16.

Top of page