Jump to content

  • Log In with Google      Sign In   
  • Create Account


WebGL and Javascript...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 FXACE   Members   -  Reputation: 182

Like
0Likes
Like

Posted 28 December 2011 - 05:44 PM

Hello guys.Posted Image

I'm writing a web project with web-gl support. So, I have these questions:

"deleteBuffer,deleteTexture,... on WebGL ?"


var texture = gl.createTexture();
// setup...
// using...
texture = null; // does it removes from GPU or not??? It's a javascript machine (I think it should contain a destructor when object removing)...


"Framebuffer: COLOR_ATTACHMENT0 exists on specification but COLOR_ATTACHMENT1 is not..."

So, is this means that mrt (Multiple Render Targets) is not supported?


Also, looks like it doesn't support depth/stencil textures. Is it true?

Best wishes, FXACE.

Sponsor:

#2 Yours3!f   Members   -  Reputation: 1300

Like
2Likes
Like

Posted 29 December 2011 - 05:25 AM


"Framebuffer: COLOR_ATTACHMENT0 exists on specification but COLOR_ATTACHMENT1 is not..."

So, is this means that mrt (Multiple Render Targets) is not supported?


Also, looks like it doesn't support depth/stencil textures. Is it true?

Best wishes, FXACE.


as far as I know in both OpenGL ES and WebGL MRT is not supported by the specification.

according to this:
OpenGL ES 2.0 §4.4.3

(as suggested on the WebGL specification page under the FramebufferRenderbuffer function)

color attachments other than the 0th are NOT supported. So you have to do multipass rendering if you still want to use this functionality.

according to this:
OpenGL ES 2.0 §3.7.1

you can only create (with TexImage2D) RGBA, ALPHA, and LUMINANCE textures, so depth and stencil texture creation isn't supported. You can only create FBOs with these (depth, stencil) attachments (and I think renderbuffers too), but still the attached textures can't have the hardware supported GL_DEPTH_COMPONENT as internal format.

according to this:
OpenGL ES 2.0 §3.7.13

you can use
void deleteTexture(WebGLTexture texture)
for deleting textures.

here's the online specification:
https://www.khronos.org/registry/webgl/specs/1.0

you can see that in a lot of places it refers to the OGL ES specification, but if you're concerned about the differences just look them up in the table of contents.

I tried to be as precise as I could, but if I'm wrong correct me :)

#3 FXACE   Members   -  Reputation: 182

Like
0Likes
Like

Posted 29 December 2011 - 05:02 PM

you can use
void deleteTexture(WebGLTexture texture)
for deleting textures.

Definitely, I can use them (if they are there). But I did mean:

1:
var texture = gl.createTexture();
gl.deleteTexture(texture);
2:
var texture = gl.createTexture();
texture = null;

Are these commands not the same? (Is there, in the second tag of code, possible a memory leak on devices?)

What about WebGL specification I can say I'm already hold it on my hands.


+ 1 question:
Is WebGL updating (new features, functionality,...) or it just staying on it's place?


Anyway, I put 'like' to your post, Yours3!f, as thanksgiving to your attention.

Best wishes, FXACE.

#4 Yours3!f   Members   -  Reputation: 1300

Like
0Likes
Like

Posted 29 December 2011 - 05:59 PM

according to this:
OpenGL ES 2.0 §3.7.13

var texture = gl.createTexture();
only means that you have created a texture, and stored its ID (in variable texture), which is not the same as its memory address. Plus in the specification the 2nd way isn't mentioned anywhere. To add you can easily find out if after either method the texture still exists via
GLboolean isTexture(WebGLTexture texture);
(OpenGL ES 2.0 §6.1.4)
Yes I do think that using the 2nd version would lead to memory leak.

The only WebGL specification is the one I mentioned in my previous post. I think its not in the usual format (pdf) because of the technology being "web".

I think they will keep updating it, but I'm not sure. They look pretty enthusiast about it, you can even find a spinning WebGL based cube on khronos.org. I'd be a huge mistake to discontinue a technology that has no competitors.

Anyway, I put 'like' to your post, Yours3!f, as thanksgiving to your attention.

You're welcome! I'm trying to master the GL/CL specifications like it was a book of Laws.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS