Jump to content

Instance SubMesh Frustum Culling


Klaas
 Share

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.

 

Link to comment
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.

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...