Jump to content

[SOLVED] - Latest 2.6 alpha crashes on mesh.dispose


MackeyK24
 Share

Recommended Posts

Has anyone else used the latest nightly 2.6 alpha (on 1/5/2017)... Because now all of sudden all my mesh disposal code crashes... I go back to a version i had forked on (1/3/2017) and includes my #1641 onCollideEvent and particle system customShader... it works great... Somehow, Something got put in after 1/3/2017 in addition to my changes that is now crashing... Its hard to make a playground ... Is toolkit project.

I will keep trying to investigate what could be the culprit that got got changed sine the last couple commits... Just wondering if anybody else is having an issue with the nightly build on 1/5/2017

@Deltakosh ... Has there been ANY new commits lately that deal with life cycle or disposal ???

 

 

Link to comment
Share on other sites

Nope, i cannot make a playground... is nested within the API... But now, all of the sudden (since that last 2.6 nightly update) the same code that has been working for awhile... now crashes on my dispose (with child meshes) with this error:

[.Offscreen-For-WebGL-0x7fc45c042c00]GL ERROR :GL_INVALID_OPERATION : glDrawElements: No element array buffer bound

Link to comment
Share on other sites

5 hours ago, Deltakosh said:

without a repro I cannot help

this seems to be related to the new webgl2 feature I added

@Deltakosh Is way to complex for playground... and is in typescript.

Can i disable webgl2 somehow to verify this is the culprit ???

This is really screwing me up big time... Now all kinds of code I have been working on for weeks... Just craps out now :(

I can package the project up (Unity Package) and you can download and check out the whole project from a toolkit point of view.

Link to comment
Share on other sites

Webgl2 AND vertex array object. This is the problem as I provided a fallback

Can you try it on Edge? THere is no support for webgl2 and VAO.

But this is unclear to me why I need Unity. You export .babylon files right? and you load these files in a browser, right? Even inside Unity. So you should be able to provide me a page and a .babylon file to test right?

Link to comment
Share on other sites

I tried with child meshes but still no problem: http://www.babylonjs-playground.com/#M7QUN#1

With advanced textures and shaders, still no problem: http://www.babylonjs-playground.com/#ALFMC

With shadows, no problem: http://www.babylonjs-playground.com/#1UBRGU

With bones AND instances, no problem: http://www.babylonjs-playground.com/#1UBRGU#1

You'll have to help me there (i'm off for 3 days, I'm going to CES).

Link to comment
Share on other sites

I found the issue... Is does not like my Shader... That is what is giving those errors.

 

My Additive Shader (to remove black backgound):

OPTIONS:

				attributes: "position, normal, uv"
				uniforms: "worldViewProjection, _Color, _Brightness, _Blackness"
				samplers: "_MainTex"
				defines: ""

 

VERTEX:

				attribute vec3 position;
				attribute vec3 normal;
				attribute vec2 uv;
				uniform mat4 worldViewProjection;
				precision highp float;

				varying vec2 vUV;
				
				void main(void)
				{
					gl_Position = worldViewProjection * vec4(position, 1.0);
					vUV = uv;
				}

 

FRAGMENT:

				precision highp float;

				varying vec2 vUV;
				uniform vec4 _Color;
				uniform sampler2D _MainTex;
				uniform float _Blackness;
				uniform float _Brightness;

				void main(void)
				{
					vec4 baseColor = texture2D(_MainTex, vUV);
					float pixel = baseColor.r + baseColor.g + baseColor.b;
					if (pixel <= _Blackness) {
						gl_FragColor = vec4(1.0, 1.0, 1.0, 0.0);
					} else {
						gl_FragColor = baseColor * _Color * _Brightness;
					}
				}

 

ERRORS (SEVERAL PER FRAME):

[.Offscreen-For-WebGL-0x7fc45c042c00]GL ERROR :GL_INVALID_OPERATION : glDrawElements: No element array buffer bound

Link to comment
Share on other sites

@Deltakosh ... I found the issue... Its any of my babylon GLSL shaders that enables "needsAlphaBlending"... If i take that off works great... (EXCEPT has black ground because the alpha is not working).

So the webgl additions don't like the needsAlphaBlending on the Shader listed Above.

OMG... Thanks god we found that issue... At least we know about where to start looking... and now all my new toolkit prefab system works great again (after i disable 'needsAlphaBlending'... Have UGLY SHOTS FOR NOW... but its working again).

I am sure we can figure that shader stuff out :)

 

Link to comment
Share on other sites

On 1/6/2017 at 7:04 PM, Deltakosh said:

Webgl2 AND vertex array object. This is the problem as I provided a fallback

Can you try it on Edge? THere is no support for webgl2 and VAO.

But this is unclear to me why I need Unity. You export .babylon files right? and you load these files in a browser, right? Even inside Unity. So you should be able to provide me a page and a .babylon file to test right?

Hey @Deltakosh attached is a zip file with all the regular .babylon scene files and scripts (index.html included)

This is using a ShaderMateral with needsAlphaBlending = true... If you look in the .babylon file and change the only needsAplhaBlending that is true --> false... No longer get errors (although still get some funny things happen like the screen will go black and not show anything BUT the meshes are still in the game and show up and inspector ... still like meshes... just nothing gets rendered... Let your self blow up in game and let all asteroid from wave go by... everything will go black... BUT THIS ALL WORKED BEFORE the vertex array object stuff... Can we just disable that with an engine create options ???)

Test Space Shooter Scene

Download Test Space Shoot Scene Files

NOTE: Check the console logs... There will be all kind of glDrawElements: No element array buffer bound errors

Please take a look at when can :)

 

Link to comment
Share on other sites

6 hours ago, Deltakosh said:

I just fixed a related bug this morning. Do you mind testing with this version?

Holy Crap Batman... I think that did it :)

Fixed both my 'NeedsAlphaBlending' and the Mysterious Black Screen when all item not visible...

 

Thanks @Deltakosh ... You da Man :)

 

Check it out now... Shots look good now (Don't pay attention to my explosions...Still working on the Particle System Prefabs)

Test Space Shooter Scene

 

Link to comment
Share on other sites

Now i can move on to my new 'Animation State' component. Basically i will be allow multiple animation clips and create a Scene Manager API:

this.manager.playAnimation("Idle", mesh)  // Plays Transform Animations

OR

this.manager.playBoneAnimation("Walk", mesh.skeleton) // Plays Skeletal Animations

WITH 

Blending Support...

Something like that... Still working on

:)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...