Hey so I'm trying to learn 3d graphics and I've came to understand that immediate mode means to draw graphics straight from when they're called like html canvas and retained mode to be drawing to buffers and calculating before "flushing" or swapping buffers But these last few days I've been learning webgl and Iv discovered that it pletely lacks what this thread What does "immediate mode" mean in OpenGL? defines as immediate mode in opengl, "gl begin()"
So this got me to think that webgl must be retained mode only, but when I was reading the spec, on this page:.0/
In the very first yellow box it says webgl is an immediate mode api? Could someone please explain what I'm getting wrong here?
Hey so I'm trying to learn 3d graphics and I've came to understand that immediate mode means to draw graphics straight from when they're called like html canvas and retained mode to be drawing to buffers and calculating before "flushing" or swapping buffers But these last few days I've been learning webgl and Iv discovered that it pletely lacks what this thread What does "immediate mode" mean in OpenGL? defines as immediate mode in opengl, "gl begin()"
So this got me to think that webgl must be retained mode only, but when I was reading the spec, on this page:http://www.khronos/registry/webgl/specs/latest/1.0/
In the very first yellow box it says webgl is an immediate mode api? Could someone please explain what I'm getting wrong here?
Share Improve this question edited May 23, 2017 at 10:30 CommunityBot 11 silver badge asked Jan 6, 2014 at 23:48 Jim JonesJim Jones 2,7098 gold badges28 silver badges44 bronze badges 3- 1 webgl is immediate mode, but lacks some of the (deprecated) functionality of opengl 1 (like the stuff sown in the linked question) retained vs immediate is broader in scope than which opengl functions are available. – user3125280 Commented Jan 6, 2014 at 23:54
- Thanks, I kind of assumed that but do you think you could explain difference in the way element arrays are rendered on an immediate canvas? – Jim Jones Commented Jan 7, 2014 at 0:33
- I couldn't, but i can say that "immediate mode" means you are creating arrays,etc and passing them to the api, etc. It is used in this context (i think) to contrast to more abstracted alternatives (since javascript is so sandboxed, people might expect webgl doesn't give graphics programmers the level of control they are used to). Purely immediate mode api would pass array everytime, purely retained would pass it once and make calls some function like DrawThatThingIJustSentYou() – user3125280 Commented Jan 7, 2014 at 0:39
2 Answers
Reset to default 10I think the root of the confusion is the thread you pointed out is using OpenGL-specific concepts of immediate mode versus retained mode.
WebGL is deemed immediate as follows:
Immediate mode API means the application must call all the rendering mands to draw the entire scene for every frame. For example, WebGL and HTML5 Canvas are immediate mode. Retained mode API means the application only describes the scene objects but DOES NOT issue rendering requests. For example, SVG is retained mode.
Have a look at this discussion on SVG (retained mode) versus Canvas (immediate mode):
SVG vs canvas: how to choose
See also:
http://en.wikipedia/wiki/Immediate_mode
http://en.wikipedia/wiki/Retained_mode
You can look at the well pictured description at http://www.craftymind./guimark2/. Basically it es down to "buffer all my state changes, and then draw once" vs, "drawing every call". In this specific case, it has to do with the Javascript model as well.