Jump to content
  • Advertisement
Sign in to follow this  
FXACE

WebGL and Javascript...

This topic is 2542 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello guys.smile.png

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


"deleteBuffer,deleteTexture,... on WebGL ?"
[/quote]


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..."
[/quote]
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.

Share this post


Link to post
Share on other sites
Advertisement


"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.
[/quote]

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 :)

Share this post


Link to post
Share on other sites

you can use
void deleteTexture(WebGLTexture texture)
for deleting textures.
[/quote]
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.

Share this post


Link to post
Share on other sites
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.[/quote]
You're welcome! I'm trying to master the GL/CL specifications like it was a book of Laws.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!