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

Feature/add instanced mesh #69

Merged
merged 13 commits into from Feb 16, 2021
Merged

Feature/add instanced mesh #69

merged 13 commits into from Feb 16, 2021

Conversation

Displee
Copy link
Contributor

@Displee Displee commented Feb 15, 2021

With InstancedMesh we can render the same geometry thousands of times with only 1 draw call. This is a big performance boost :)
I've implemented this example: https://threejs.org/examples/webgl_instancing_raycast

CVyMBz8WsF

Since r106 didn't have this feature, I ripped it from the last threejs release (r125).

@Displee
Copy link
Contributor Author

Displee commented Feb 15, 2021

For some odd reason the HemisphereLights in the example doesn't cast any light. I'm using a custom color (whitesmoke) for the geometries, but that shouldn't be needed. Should I create an issue for this?

@markaren
Copy link
Owner

For some odd reason the HemisphereLights in the example doesn't cast any light.

But it does? removing one of the lights clearly alters the perceived color of the spheres

@markaren
Copy link
Owner

Nice work btw

@markaren markaren merged commit dcb8f86 into markaren:master Feb 16, 2021
@Displee
Copy link
Contributor Author

Displee commented Feb 16, 2021

For some odd reason the HemisphereLights in the example doesn't cast any light.

But it does? removing one of the lights clearly alters the perceived color of the spheres

Well. The geometries should turn white like in the original example without the custom 'whitesmoke' color. If I remove the 'whitesmoke' color the geometries will turn black instead of white.

@markaren
Copy link
Owner

Aight, I see what is happening.
In three.kt Color() -> black (0,0,0)
In three.js Color() -> white(1,1,1)

@markaren
Copy link
Owner

Pushed a fix to master. Default rgb color is now white, not black

@Displee
Copy link
Contributor Author

Displee commented Feb 16, 2021

Ah, good job.

@Displee Displee deleted the feature/add-instanced-mesh branch February 16, 2021 11:11
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

Successfully merging this pull request may close these issues.

None yet

2 participants