Jump to content

Render to texture


IgorBgz90
 Share

Recommended Posts

There is a way to get the texture of the buffer, without a strong drawdown FPS?

 

Simple code of Monitor:

function Script:Start()
--Material
self.material = Material:Load("Materials/Monitor/monitor.mat")
self.entity:SetMaterial(self.material)

--Buffer
self.buffer = Buffer:Create(App.window:GetWidth(),App.window:GetHeight(),1,0);
self.buffer:SetColorTexture(Texture:Create(App.context:GetWidth(),App.context:GetHeight()))
self.buffer:Disable();
end

function Script:UpdateWorld()

self.buffer:Clear()
self.buffer:Enable()
self.entity:Hide()
--self.camera:Show()
App.world:Render()
--self.camera:Hide()
self.buffer:Disable()

self.material:SetTexture(self.buffer:GetColorTexture(),0)

Context:SetCurrent(App.context)
self.entity:Show()
end

 

One monitor, point light and room 4x4

As a result, the FPS - 5 wacko.png

If two monitor FPS - 10 etc

 

Implementation in irrlicht engine:

ITexture* RTTTex = driver->createRenderTargetTexture(dimension2d<s32>(512,512));

Result over 75 fps (For me)

 

Demo, Source code and shaders: irrlicht.zip

post-13485-0-31451500-1425833048_thumb.png

Link to comment
Share on other sites

If your hardware and scene are getting 30 FPS to begin with there's not a lot you can do to make multiple renders faster.

 

The simplest things are:

  • Lower screen resolution.
  • Lower quality settings.

 

I can't comment beyond that because I don't know what GPU you have.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...