Away3d have a RenderTexture class, but i can’t figure out how to use it). So my question is: how can i render to texture for later use in some material? Moreover, can i use Starling framework for rendering to my away3d material?
Render to textureSoftware: Away3D 4.x |
||
|
||
Richard Olsson, Administrator
Posted: 25 July 2012 08:16 AM Total Posts: 1192 [ # 1 ] The RenderTexture class is basically just a dummy texture that is then used as a render target to render depth passes on the GPU. The same could actually be done to any texture. However, rendering to texture isn’t really exposed to the user (you) in the Away3D API. You could hack View3D though to pass in a texture to _renderer.render() on line 609. As far as using a texture created by Starling goes, as long as you can access the Stage3D texture object in Starling, you should be able to wrap it into your own sub-class of TextureProxyBase and use it virtually anywhere in the material/shading system of Away3D. Just make sure that Starling and Away3D use the same Context3D instance, or the texture memory will not be shared. |