How much more efficient are power-of-two textures?

前端 未结 1 2048
天命终不由人
天命终不由人 2021-01-18 18:04

I am creating an OpenGL video player using Ffmpeg and all my videos aren\'t power of 2 (as they are normal video resolutions). It runs at fine fps with my nvidia card but I\

1条回答
  •  不知归路
    2021-01-18 18:33

    Writing a video player you should update your texture content using glTexSubImage2D(). This function allows you to supply arbitarily sized images, that will be placed somewhere in the target texture. So you can initialize the texture first with a call of glTexImage() with the data pointer being NULL, then fill in the data.

    The performance gain of pure power of 2 textures strongly depends on the hardware used, but in extreme cases it may be up to 300%.

    0 讨论(0)
提交回复
热议问题