Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Render to texture efficiency

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
4 replies to this topic

#1 gchris6810   Members   

207
Like
0Likes
Like

Posted 09 June 2014 - 01:06 PM

Hi,

 

I am working on creating a level editor that contains 4 unique views (3 plan views and 1 3D view). I was thinking that rather than lots of context switching to update all 4 views simultaneously I could partition a single window and have all draw calls mapped to 4 textures, that could then be mapped to the relevant parts of the window. I have a few questions:

 

1. Is it possible to do this and make it look correct?

2. Is swapping between textures any faster than swapping between windows?

3. Is there a better way to do this than those I have suggested?

 

Thanks in advance.



#2 Kaptein   Prime Members   

2216
Like
2Likes
Like

Posted 09 June 2014 - 02:27 PM

1. Definitely

2. Probably, maybe. Yes.

3. There's a godzillion ways of doing just about anything. I think splitting a screen from a single context into 4 viewports make complete sense, and shouldn't be very complicated to do.

 

4 textures sounds good.

 

For the viewport separation, I think glViewport() can singlehandedly do all of this for you.

See: http://www.opengl.org/sdk/docs/man/docbook4/xhtml/glViewport.xml

But, I'm not completely sure. If it doesn't work that way, just use matrix-fu to align the coordinate systems correctly.


Edited by Kaptein, 09 June 2014 - 02:28 PM.


#3 swiftcoder   Senior Moderators   

18215
Like
3Likes
Like

Posted 09 June 2014 - 02:30 PM


For the viewport separation, I think glViewport() can singlehandedly do all of this for you.

You'll probably need to use glScissor() as well, to avoid overwriting the other viewports.


Tristam MacDonald - Software Engineer @ Amazon - [swiftcoding] [GitHub]


#4 gchris6810   Members   

207
Like
0Likes
Like

Posted 09 June 2014 - 02:41 PM

The separate viewports option sounds like a much better idea. I'll go with that.



#5 mhagain   Members   

13154
Like
1Likes
Like

Posted 09 June 2014 - 05:41 PM

If you need to draw the same geometry to different viewports you can handle all 4 in a single draw call by adding a geometry shader and writing to gl_ViewportIndex.  See http://www.ecse.rpi.edu/~wrf/wiki/ComputerGraphicsFall2013/SuperBible/SB6/code/src/multiviewport/multiviewport.cpp for some sample code.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.