Coffeehouse Post

Single Post Permalink

View Thread: How do the new Silverlight immediate mode / 3D graphics APIs relate to XNA?
  • User profile image

    , rhm wrote

    XNA, OpenGL and WebGL are all immediate mode APIs so it could be like any of them. Making it like XNA would make sense so that if they ever bring it to WP7, it'll drop in easily for devs that already have XNA experience there. Likewise for XBox. On the other hand, making it like WebGL would be a plus from the point of view of web developers.

    I think this is one of the situations where a technology label applied in different context means different things to different people. When Silverlight people think about immediate mode, as oppossed to retained mode, they think of a rendering system where graphical objects and their related resource are created and cached/reused over each drawn frame and otherwise managed by the rendering engine. Unfortunately immediate mode may have a different meaning to OpenGL and Direct3D developers.

    In the OpenGL and Direct3D spheres, immediate mode can mean drawing without using batch draw commands, specifically drawing from vertex buffers. A vertex buffer is a memory location, typically in video memory, where vertex data and other data attributes are stored and then used from batch draw commands such as glDrawElements. Such immediate drawing code would look like this:

    glBegin(GL_QUADS); glVertex(...); glVertex(...); glVertex(...); glVertex(...); glEnd(); // creates a rectangle in 3D space

    Instead, what I believe the Silverlight team means by immediate mode is the opposite of what that term means to OpenGL and Direct3D programmers. That is to say Silverlight 5 will employ vertex buffers and batch drawing command on a per frame basis, much like using glDrawElements to render a complex 3D model from a bunch of vertex data in one function call.