RenderTexture

nolver

23-02-2006 18:53:13

How to do Render to Texture?

I've trying the classic way, but found that

OgreDotNet.MaterialManager.GetSingleton().create()

returns a ResourcePrt, and I cannot cast it to MaterialPtr, to create the texture stage and so on...

and how can I setup the RenderTargetListener??

rastaman

24-02-2006 07:39:50

Looks like we need to create a custom director for RenderTargetListener. I will try and do that tomarrow.

The cast problem is because c# and swig don't allow multiple inheritances. Well c# allows inheritance from multiple interfaces, but not from normal classes.
I'll create a static function in MaterialPtr to do this, but you could do it manually now. Just create a new MaterialPtr with the Swig constructor like :

//resPtr is the ResourcePtr from MaterialManager.create
MaterialPtr matPtr = new MaterialPtr( ResourcePtr.getCPtr(resPtr).Handle, false);

nolver

26-02-2006 13:25:41

Your suggestion did work perfectly!

Thank you rastaman!

rastaman

27-02-2006 02:31:26

CVS now has the updates for RenderTargetListener, and a new Demo RenderToTexture to show how to use it.