OpenGL ES 或 Direct3D 中的表面究竟是什麼? (What exactly is a surface in OpenGL ES or Direct3D?)


問題描述

OpenGL ES 或 Direct3D 中的表面究竟是什麼? (What exactly is a surface in OpenGL ES or Direct3D?)

I did not find a good definition of the concept of a drawing surface. What properties are associated with a surface? In the context of pure OpenGL there is no surface, since OpenGL has no notion of window system specific things. In OpenGL ES though you have the EGL API, which introduces the concept of a drawing surface, without defining it properly. What is your concise definition of a drawing surface?


參考解法

方法 1:

Basically, a surface is something that you can render to. It's a kind of device context, but potentially smarter since surfaces may know how to display themselves or do other useful things. EGL has three surface types:

  • Window Surface: a window.
  • Pixmap Surface: an image.
  • Pbuffer Surface: a pixel buffer.

This forum post may be helpful.

方法 2:

In the Direct3D world, broadly speaking, a surface is some 2D image data. A texture is something that can be sampled and used in a shader. Typically textures are 'made of' surfaces; for example, each mip-map of a 2D texture is a surface, and each face of a cube map is a surface.

方法 3:

In Direct3D, a hardware surface is typically -- but not always -- a section of hardware memory in the DirectDraw surface format. This is the same format used by DDS image files, and basically consists of a header, and then image data in one of several image formats that are specified in the header section. The usual properties are width, height, pixel format, and maybe a few misc things like stereo (which may not actually be supported, of course).

It's basically not much more than a generic term for an image.

(by nschmidtNaaffsdclibberyPromit)

參考文件

  1. What exactly is a surface in OpenGL ES or Direct3D? (CC BY-SA 3.0/4.0)

#3d #direct3d #graphics #opengl-es






相關問題

OpenGL ES 或 Direct3D 中的表面究竟是什麼? (What exactly is a surface in OpenGL ES or Direct3D?)

為什麼我們需要維護自己的矩陣來轉換遊戲對象? (Why we need to maintain our own matrices to transform Game objects?)

將兩個 4x4 矩陣連接在一起? (Concat two 4x4 matrices together?)

使用 matplotlib 保存散點圖動畫 (Saving scatterplot animations with matplotlib)

如何在 Matlab 中為這個 3D 繪圖設置動畫? (How to animate this 3D plot in Matlab?)

用java加載最簡單的靜態模型格式? (easiest static model format to load with java?)

在 GLSL 中混合多個紋理 (Blending multiple textures in GLSL)

在 3D 中可視化 10,000 個陰影框的最簡單方法 (Easiest way to visualize 10,000 shaded boxes in 3D)

如何圍繞其中心旋轉 3D 模型? (How to rotate a 3D model around its center?)

如何計算一個長方體與其相鄰長方體的接觸面積 (How to calculate area of contact of one rectangular cuboid to its adjacent cuboids)

在多視圖幾何中最接近另一個 3D 點的線上查找 3D 點? (To find 3D point on a line closest to another 3D point in Multi-view Geometry?)

GLUT 環面與相機相撞 (GLUT torus colliding with camera)







留言討論