void OMBackBuffer_Resized(Graphics.RenderTarget renderTarget) { var device = GraphicDeviceFactory.Device; int width = renderTarget.Width; int height = renderTarget.Height; //positionRT = new RenderTexture2D(width, height, Format.R32G32B32A32_FLOAT); //positionRT = new RenderTexture2D(width, height, Format.R16G16B16A16_FLOAT); _positionRt = new RenderTexture2D(width, height, Format.R16G16B16A16_UNORM); _normalRt = new RenderTexture2D(width, height, Format.R16G16B16A16_UNORM); _diffuseRt = new RenderTexture2D(width, height, Format.R8G8B8A8_UNORM); _specularRt = new RenderTexture2D(width, height, Format.R8G8B8A8_UNORM); _renderTargets = new RenderTarget[] { _positionRt.Target, _normalRt.Target, _diffuseRt.Target, _specularRt.Target }; _textures = new Texture2D[] { _positionRt.Texture, _normalRt.Texture, _diffuseRt.Texture, _specularRt.Texture }; }
public override void Unbind(Graphics.RenderTarget target) { // Copy on unbind GLESSurfaceDescription surface; surface.Buffer = null; surface = (GLESSurfaceDescription)target["TARGET"]; if (surface.Buffer != null) { ((GLESTextureBuffer)surface.Buffer).CopyFromFramebuffer(surface.ZOffset); } }
public ActorFace(Resource.ResourceManager content, string actorCode) { _actorCode = actorCode; _faceDefinition = FaceDefinitions.GetFaceDefinition(actorCode); if (_faceDefinition == null) { // some actors don't have faces (like the chicken) _isEmptyFace = true; return; } _baseFace = content.Load <Graphics.TextureResource>(_faceDefinition.FaceName + ".BMP"); _mouths = new Graphics.TextureResource[8]; _mouths[0] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH00.BMP"); _mouths[1] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH01.BMP"); _mouths[2] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH02.BMP"); _mouths[3] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH03.BMP"); _mouths[4] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH04.BMP"); _mouths[5] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH05.BMP"); _mouths[6] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH06.BMP"); _mouths[7] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH07.BMP"); _smiles = new Graphics.TextureResource[2]; _smiles[0] = content.Load <Graphics.TextureResource>(actorCode + "_SMILE_01.BMP"); _smiles[1] = content.Load <Graphics.TextureResource>(actorCode + "_SMILE_02.BMP"); if (Graphics.RendererManager.CurrentRenderer.RenderToTextureSupported) { _renderTarget = Graphics.RendererManager.CurrentRenderer.CreateRenderTarget(_baseFace.Width, _baseFace.Height); _generatedFace = _renderTarget.Texture; } else { _generatedFace = Graphics.RendererManager.CurrentRenderer.CreateUpdatableTexture(actorCode + "_FACE", _baseFace.Width, _baseFace.Height); } updateTexture(false); }
/// <summary> /// Bind a certain render target if it is a FBO. If it is not a FBO, bind the main frame buffer. /// </summary> /// <param name="target"> </param> public override void Bind(Graphics.RenderTarget target) { /// Check if the render target is in the rendertarget->FBO map GLESFrameBufferObject fbo = null; fbo = target["FBO"] as GLESFrameBufferObject; if (fbo != null) { fbo.Bind(); } else { // Old style context (window/pbuffer) or copying render texture #if AXIOM_PLATFORM_IPHONE // The screen buffer is 1 on iPhone OpenGLOES.BindFramebuffer(All.FramebufferOes, 1); #else OpenGLOES.BindFramebuffer(All.FramebufferOes, 0); #endif GLESConfig.GlCheckError(this); } }
public override void Bind(Graphics.RenderTarget target) { //Check if the render target is in the rendertarget.FBO map GLES2FrameBufferObject fbo = null; fbo = (GLES2FrameBufferObject)target["FBO"]; if (fbo != null) { fbo.Bind(); } else { //Old style context (window/pbuffer) or copying render texture //Ogre says 1 is screenbuffer on iOS as opposed to 0 on Android #if MONOTOUCH GL.BindFramebuffer(GLenum.Framebuffer, 1); #else GL.BindFramebuffer(GLenum.Framebuffer, 0); #endif GLES2Config.GlCheckError(this); } }
void OMBackBuffer_Resized(Graphics.RenderTarget obj) { Initialize(); }
public override void Bind(Graphics.RenderTarget target) { // Nothing to do here // Binding of context is done by GL subsystem, as contexts are also used for RenderWindows }
public override void Unbind(Graphics.RenderTarget target) { base.Unbind(target); }