Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic instancing #261

Open
trusktr opened this issue May 15, 2023 · 0 comments
Open

Automatic instancing #261

trusktr opened this issue May 15, 2023 · 0 comments

Comments

@trusktr
Copy link
Member

trusktr commented May 15, 2023

Given some sub tree,

<lume-element3d>
	<lume-mesh has="phong-material sphere-geometry" ...></lume-mesh>

		<lume-element3d>
			<lume-mesh has="physical-material sphere-geometry" ...></lume-mesh>

			<lume-mesh has="phong-material sphere-geometry" ...></lume-mesh>
		</lume-element3d>

		<lume-element3d>
			<lume-mesh has="physical-material sphere-geometry" ...></lume-mesh>
		</lume-element3d>
</lume-element3d>

we'd be able to wrap it with auto instancing,

<lume-autoinstance>
	<lume-element3d>
		<!-- A -->
		<lume-mesh has="phong-material sphere-geometry" ...></lume-mesh>

		<lume-element3d>
			<!-- B -->
			<lume-mesh has="physical-material sphere-geometry" ...></lume-mesh>

			<!-- A -->
			<lume-mesh has="phong-material sphere-geometry" ...></lume-mesh>
		</lume-element3d>

		<lume-element3d>
			<!-- B -->
			<lume-mesh has="physical-material sphere-geometry" ...>
				<!-- A -->
				<lume-mesh has="phong-material sphere-geometry" ...></lume-mesh>
			</lume-mesh>
		</lume-element3d>
	</lume-element3d>
</lume-autoinstance>

and it would instance the meshes marked with A, ad the meshes marked with B, so the result would be like having two InstancedMeshes.

Maybe it can be behaviors:

	<lume-element3d has="autoinstance">
		<!-- ...same as before... -->
	</lume-element3d>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant