Klaas

Instance SubMesh Frustum Culling

Recommended Posts

Hello!

I discovered, what i call a bug, with instances and frustum culling.

When the original mesh got submeshes the submesh culling of the instances relate to the position of the original mesh. This results in disappearing instances (submeshes) when the original mesh leaves the frustum.

My quick hack was

	BABYLON.SubMesh.prototype.isInFrustum = function (frustumPlanes) {
		if( this._mesh._isAllwaysInFrustum )return true;
		var boundingInfo = this.getBoundingInfo();
		if (!boundingInfo) {
			return false;
		}
		return boundingInfo.isInFrustum(frustumPlanes);
	};

//then setting
orginalMesh._isAllwaysInFrustum = true;

I think the current behaviour is not intended.

 

Share this post


Link to post
Share on other sites

Hi!
i have to admit you are right. That doesnt seem to be the problem in my scene. But the code fixed the problem !?!?!

I've tried to reproduce the problem in PG, but it doesnt show up.

Now im more convinced the problems lies in the LOD and multimat system.

But ... look here http://test.pixotron.net/submeshbug/submeshbug.html

when you turn around an navigate the materials get pretty mixed up.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.