Skip to main content
added 232 characters in body
Source Link
George
  • 133
  • 7

I have drawn image with OpenGL and will redraw tile of its texture (non filled area).

enter image description here

Which case will work faster?

  1. Set glViewport with full texture's rect, draw full texture and use glScissor with updated area's rect.
  2. Set glViewport with updated area's rect and draw tile of texture with calculating its texture coordinates.

I've found in Apple's documentation, that scissor test is called after fragment shader. Does this mean, that fragment shader will work with pixels of full texture? How slower will it be rendered than case 2?

SOLVED: I've viewed pipeline scheme of OpenGL ES 2.0 here. Scissor test is done before fragment shading and allow to optimise rendering.

I have drawn image with OpenGL and will redraw tile of its texture (non filled area).

enter image description here

Which case will work faster?

  1. Set glViewport with full texture's rect, draw full texture and use glScissor with updated area's rect.
  2. Set glViewport with updated area's rect and draw tile of texture with calculating its texture coordinates.

I've found in Apple's documentation, that scissor test is called after fragment shader. Does this mean, that fragment shader will work with pixels of full texture? How slower will it be rendered than case 2?

I have drawn image with OpenGL and will redraw tile of its texture (non filled area).

enter image description here

Which case will work faster?

  1. Set glViewport with full texture's rect, draw full texture and use glScissor with updated area's rect.
  2. Set glViewport with updated area's rect and draw tile of texture with calculating its texture coordinates.

I've found in Apple's documentation, that scissor test is called after fragment shader. Does this mean, that fragment shader will work with pixels of full texture? How slower will it be rendered than case 2?

SOLVED: I've viewed pipeline scheme of OpenGL ES 2.0 here. Scissor test is done before fragment shading and allow to optimise rendering.

Tweeted twitter.com/#!/StackGameDev/status/410981242696658945
Source Link
George
  • 133
  • 7

iOS: OpenGL ES 2.0 render texture with glScissor performance

I have drawn image with OpenGL and will redraw tile of its texture (non filled area).

enter image description here

Which case will work faster?

  1. Set glViewport with full texture's rect, draw full texture and use glScissor with updated area's rect.
  2. Set glViewport with updated area's rect and draw tile of texture with calculating its texture coordinates.

I've found in Apple's documentation, that scissor test is called after fragment shader. Does this mean, that fragment shader will work with pixels of full texture? How slower will it be rendered than case 2?