[Bf-cycles] realtime preview

Mohamed Sakr 3dsakr at gmail.com
Thu Nov 12 13:58:16 CET 2015


Hi Nathan,

thanks a lot! :)
there are 2 things that I need to understand:
1- if I change the scene data "so the scene is always there" ,
cancel/restart the session performance penalty is ok? (I'm forced to
background = true)
2-
https://github.com/mcneel/RhinoCycles/blob/5a04498c14779533395bbb59b649e33dec4e0f0d/RenderEngines/ViewportRenderEngine.cs#L200-L202
I kinda don't understand how do we wait here? assuming you call everything
from a separate thread, the main thread will handle messages and the
separate thread will be locked in rendering?

cheers,
Mohamed Sakr

On Thu, Nov 12, 2015 at 2:31 PM, Nathan Letwory <nathan at mcneel.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> And hi again,
>
> I wanted to illustrate what I'm doing with some links into the source
> of RhinoCycles. It might help see how it could be done. (And I'm
> assuming here I understood Cycles session management properly ;)
>
> Links interspersed in message below.
>
> On 12/11/2015 14:19, Nathan Letwory wrote:
> > Hi,
> >
> > On 12/11/2015 13:55, Mohamed Sakr wrote:
> >> Hi,
> >
> >> this crashes at some point, any ideas about the general logic
> >> here? note that I'm working with background = true
> >
> > With my work on RhinoCycles integration I have found that modifying
> > a running render session with background=true isn't very easy to
> > do. You'll have to first cancel the running session, push your
> > changes, then reset and restart.
>
> Not so long ago I was still using background-rendering in RhinoCycles.
> The update and render cycle look like this:
>
>
> https://github.com/mcneel/RhinoCycles/blob/5a04498c14779533395bbb59b649e33dec4e0f0d/RenderEngines/ViewportRenderEngine.cs#L150
>
> This worked together with a check for changes (and possible upload) here:
>
>
> https://github.com/mcneel/RhinoCycles/blob/5a04498c14779533395bbb59b649e33dec4e0f0d/RenderEngine.cs#L150
>
> - From CheckFlushQueue() you can see that I cancel the session before
> starting upload to Cycles.
>
> > If you render with background=false you can first pause the
> > session, then lock, update, reset and unpause.
>
> Simple start for the render session in RhinoCycles happens here:
>
>
>
>
> https://github.com/mcneel/RhinoCycles/blob/master/RenderEngines/ViewportRenderEngine.cs#L153
>
>
>
> Up until this basic session, scene and their parameters have been
> created and connected.
>
>
>
> CheckFlushQueue() checks if there are any changes in the changequeue,
> which at this point will be true. Synchronize() will pause the
> session, push the data, reset and unpause.
>
>
>
> Similarly, while the interactive render session is running I
> periodically check for new changes, which I do in the class governing
> that:
>
> https://github.com/mcneel/RhinoCycles/blob/master/Viewport/RenderedViewport.cs
> , more specifically in the UiUpdate() function here
>
> https://github.com/mcneel/RhinoCycles/blob/master/Viewport/RenderedViewport.cs#L125
>
>
> Hopefully this helped.
>
> /Nathan
>
>
> >
> >
> >> cheers, Mohamed Sakr
> >
> >
> >
>
> - --
> Nathan Letwory
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iQEcBAEBCAAGBQJWRIamAAoJEKtfN7KsE0TtIkMH/3BJb+0PTMvNqzLdkEngOaXJ
> UL7WqqyQ6ZgTfS8DYN9cnIqhM9TbLHvm9i3E/Xag7wO8F7nAQozAF1VQGJx+5jMM
> AGqFL6/rXQQf+Vhy12FQ3dLUzsBVdDB/jRubvQXnm20Be1cgBEUQXWSenv0jQ4bg
> 1QLC89D+kvTFtctwAZDouu/ZPl6jpkJydJf9JxUhoUiXQ8PBY1TR70Lz/sGfgw9w
> uhOFkETOOl7PcAik6Vqfo6g7Rm33icKOPVtbkVf2nwbUHnbDnwmrqBX34kAeWrGK
> 3BxdvEb7YcqneIFWdXGc8NYtsioyCzimx/Wl4+eTl2P9Z1lvpt6TiCJMS1jKHBU=
> =Ducn
> -----END PGP SIGNATURE-----
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> http://lists.blender.org/mailman/listinfo/bf-cycles
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-cycles/attachments/20151112/3478100f/attachment.htm 


More information about the Bf-cycles mailing list