mrdoob

mrdoob

Member Since 12 years ago

London

Experience Points
1.74w
follower
Lessons Completed
156
follow
Lessons Completed
213
stars
Best Reply Awards
44
repos

1710 contributions in the last year

Pinned
⚡ JavaScript 3D Library.
⚡ JavaScript Performance Monitor
⚡ JavaScript Texture Generator
⚡ Online live editor for fragment shaders.
⚡ JavaScript Sequence Editor
⚡ Simple editor for messing around.
Activity
Oct
21
21 hours ago
Activity icon
issue

mrdoob issue comment google/model-viewer

mrdoob
mrdoob

No lighting occasionally in Safari (mostly)

image

Hi, we have experienced this issue sometimes on iOS Safari (14.0.1 Macbook M1 Pro) and on an Android phone (Fairphone 3 / Android 10 / Chrome).

It disappears and reappears randomly by reloading the browser tab. Also for the main "astronaut.glb" example on your example site it's the same. I tried to add directional lights to our 3D model, this addds a third state:

1.) Normal perfect evenly lit. 2.) Unlit completely black 3.) Directional lit, a little bit, our custom changes.

If you reload the browser tab you can experience the states jumping randomly. As a side fact, I read out any modelviewer details like exposure, materials, etc. They seem to be identically, so there is no correlation with a bad setting or anything like this. I think there is some problem "under the hood".

Thanks for your help! Stefan

mrdoob
mrdoob

Has anyone tried with 15.1 yet? (not 15.0.1)

Activity icon
issue

mrdoob issue comment mrdoob/three.js

mrdoob
mrdoob

Mesh shaders

With the release of Unreal Engine 5 we have seen the power of mesh shaders, which serve as an advanced auto level of detail mechanisms that can push the limits of graphics in real-time graphics. Unreal Engine 5 certainly uses more than just this, but as a starting point, mesh shaders are one of the tools probably used under the hood, and would certainly be a great start

Nvidia demo of mesh shaders: https://developer.nvidia.com/blog/using-turing-mesh-shaders-nvidia-asteroids-demo/

I'm sometimes frustrated by the low performance of modern looking 3d experiences on low-end devices, there are many ways to aid performance, but none as powerful and as potentiated as a mesh shader, such an implementation could give rise to more advanced and scenic in-browser 3d experiences

I would love to see even a basic implementation of such a mechanism, perhaps in the form of a GLSL shader combined with core engine logic to support it, because long are the days of handling LODs manually

Have an accessible module perhaps in a beta phase in threejs examples showcasing a working implementation to adapt further from, there are already systems in place for decimating geometry, why not implement them automatically and further expand upon them?

With a working mesh shader and the use of effective instancing, we could have a breakthrough web engine for 3d experiences, that could become more accessible to low-end devices, with higher-end graphics by automatically decimating object geometry in relation to distance from the camera

mrdoob
mrdoob

Ah! Geometry shaders...

Oct
20
1 day ago
Activity icon
issue

mrdoob issue comment mrdoob/three.js

mrdoob
mrdoob

Texture: Add userData.

Related issue: https://discourse.threejs.org/t/texture-has-no-userdata/27813

Description

This was requested at the forum. Since materials, geometries and 3D objects have a userData property, it seems appropriate to add it for textures, too.

pull request

mrdoob pull request mrdoob/three.js

mrdoob
mrdoob

Texture: Add userData.

Related issue: https://discourse.threejs.org/t/texture-has-no-userdata/27813

Description

This was requested at the forum. Since materials, geometries and 3D objects have a userData property, it seems appropriate to add it for textures, too.

Activity icon
issue

mrdoob issue comment mrdoob/three.js

mrdoob
mrdoob

Lightmaps and metals

In MeshStandardMaterials lightmaps are applied to the diffuse light component, but not the specular reflections. This makes sense because shadows don't fall on mirrors, but I think the logic isn't quite right for rough metals. Obviously smooth metals are a special case, but rough metals such as brushed aluminium do have shadows.

Blender's Principled BSDR shader in Cycles renders shadows on metal:

Screenshot 2021-10-14 at 13 14 46

The pods in the scene are arranged with roughness going from 0% to 100% bottom-to-top and metallic going from 0% to 100% left-to-right.

If I generate a lightmap for this scene in Blender and export that for use in three.js (via Mozilla Hubs using their GLTF extension) I get the following output:

Screenshot 2021-10-14 at 13 19 16

The top row clearly shows the shadow effect diminishing with the increase of the metallic factor.

In simplistic terms, this could be fixed if the scattered light from the rough metal surface (the diffuse-like part of the specular component) was also attenuated by the lightmap.

mrdoob
mrdoob

@rawnsley What is exported from blender as a "light map" is likely not what three.js considers to be a light map.

@rawnsley @netpro2k Do you know if Unity, Unreal, Godot, ... treat light maps the same way Blender does?

Activity icon
issue

mrdoob issue comment mrdoob/three.js

mrdoob
mrdoob
materialPoints.positionNode = new Nodes.SkinningNode( skinnedMesh );

Is this something that will be able to be hidden in a future THREE.PointsMaterial? It's kind of similar to the skining: true that we removed recently...

Activity icon
issue

mrdoob issue comment mrdoob/three.js

mrdoob
mrdoob

Remove WebGL1 support?

I thought it was a nice issue to raise. WebGL2 as minimum would make a lot of things better in the library, for instance with the bone textures the glsl code becomes way nicer and requires one less uniform, because we can read texture sizes directly in the shader. I suspect this may apply elsewhere as well and for sure a lot of branches in the renderer will be eliminated. Is there still userbase out there that doesn't support WebGL2? It's like almost a decade old mobile technology

mrdoob
mrdoob

@jeremy-coleman

I am probably in the top 0.1 % of household income globally and my phone (iphone 6) doesnt support webgl2. Dont be ridiculous.

There's no place for that tone here.

Activity icon
issue

mrdoob issue comment mrdoob/three.js

mrdoob
mrdoob

Docs: Remove renderBufferDirect().

Related issue: Fixed #22703.

Description

This PR removes the documentation of WebGLRenderer.renderBufferDirect(). The method is not supposed to be a part of the public API.

Activity icon
issue

mrdoob issue comment mrdoob/three.js

mrdoob
mrdoob

TrackballControls: Fix pinch to zoom with ortho cams.

Related issue: Fixed #22702.

Description

Fixes the pinch to zoom gesture for orthographic cameras in TrackballControls.

Activity icon
issue

mrdoob issue comment mrdoob/three.js

mrdoob
mrdoob

WebGLShadowMap: Make VSM samples a define.

Related issue: Fixed #22690.

Description

Makes the samples uniform of the VSM shader to a define in order to avoid a GLSL compilation error.

Oct
19
2 days ago
Activity icon
issue

mrdoob issue comment mrdoob/three.js

mrdoob
mrdoob

renderBufferDirect doesn't work

Describe the bug

renderBufferDirect has 2 major caveats that aren't really stated anywhere:

  • it can only be invoked while renderer is running .render method, trying to invoke it outside of there will result in error telling you that .state is not properly set, and since you can't build it yourself (various pieces are private) - if you want to use renderBufferDirect - you are forced to create a fake scene, and hook into it's onBeforeRender, which is super hacky.
  • Second, you can not render things that you haven't rendered before in this frame. That is, if you try to use this method to render something new - you will pretty much fail. Why? Because internally WebGLRenderer doesn't just throw geometry at this method, it uses WebGLGeometries.update method as well as WebGLGeometries.get methods to update GL state, I'm guessing it's attribute buffers as well as UBOs.

To Reproduce

  • Create a new renderer
  • try to invoke renderBufferDirect

Expected behavior

Not really sure, I would expect it to be possible to render directly without having to go through WebGLRenderer.render method, but if you think that's too much to ask - I suggest removing the method entirely. As it currently exists - it's less than useful. I personally have wasted a lot of time figuring these limitations out the hard way, I'm sure there are others, and as long as the method exists in its current form - it's a buggy mess of a feature.

Platform:

  • Device: n/a
  • OS: n/a
  • Browser: n/a
  • Three.js version: at least r129 all the way up to current (r133), could be earlier too.
Activity icon
issue

mrdoob issue comment mrdoob/three.js

mrdoob
mrdoob

3MFLoader: fixed multiple build items refecering the same object bug

Multiple build items that reference the same resource object were being ignored as they referenced the same Object3d object. Also the build items meshes were using the same BufferGeometry's reference.

Activity icon
published release v0.1.28

mrdoob in mrdoob/glsl-sandbox create published release v0.1.28

createdAt 2 days ago
Activity icon
created tag

mrdoob in mrdoob/glsl-sandbox create tag v0.1.28

createdAt 2 days ago
push

mrdoob push mrdoob/glsl-sandbox

mrdoob
mrdoob

Improved gallery button behaviour.

commit sha: 7da7750534fac18765a0819468ec626ed008b542

push time in 2 days ago
Activity icon
published release v0.1.27

mrdoob in mrdoob/glsl-sandbox create published release v0.1.27

createdAt 2 days ago
Activity icon
created tag

mrdoob in mrdoob/glsl-sandbox create tag v0.1.27

createdAt 2 days ago
Activity icon
issue

mrdoob issue comment mrdoob/glsl-sandbox

mrdoob
mrdoob

design the `login` page

hello 👋 I tried to follow the design of the website: https://glslsandbox.com. That is to say, to respect the current graphic chart and try to adapt it for a login page. You are free to make any changes you want. Let me know if I have forgotten anything important 👽

before

glsl-sandbox-login-page-before

after

glsl-sandbox-login-page-after

push

mrdoob push mrdoob/glsl-sandbox

mrdoob
mrdoob

design the login page (#79)

  • design the login page

  • remove forgot password

commit sha: a3ee2864f6add39e32461513b5d7096f103ae506

push time in 2 days ago
pull request

mrdoob pull request mrdoob/glsl-sandbox

mrdoob
mrdoob

design the `login` page

hello 👋 I tried to follow the design of the website: https://glslsandbox.com. That is to say, to respect the current graphic chart and try to adapt it for a login page. You are free to make any changes you want. Let me know if I have forgotten anything important 👽

before

glsl-sandbox-login-page-before

after

glsl-sandbox-login-page-after

Activity icon
published release v0.1.26

mrdoob in mrdoob/glsl-sandbox create published release v0.1.26

createdAt 2 days ago
Activity icon
created tag

mrdoob in mrdoob/glsl-sandbox create tag v0.1.26

createdAt 2 days ago
push

mrdoob push mrdoob/glsl-sandbox

mrdoob
mrdoob

Back button when coming from the gallery.

commit sha: 0c48c11c7580c0d193bc2b4a4be8572d437e3497

push time in 2 days ago
Activity icon
issue

mrdoob issue mrdoob/glsl-sandbox

mrdoob
mrdoob

Loading Background Images

I am interested in using GLSL sandbox to develop 2D image filters using GLSL pixel shaders. If I could somehow specify a background image that can be used as input that would be AMAZING!

Activity icon
issue

mrdoob issue mrdoob/glsl-sandbox

mrdoob
mrdoob

Save/Load

Are there any save / load features in the works? Was thinking of adding either HTML5 local storage or File API capabilities

pull request

mrdoob pull request mrdoob/glsl-sandbox

mrdoob
mrdoob

New Save Load Capabilities

Added capabilities to save and load from HTML5's local storage, plus saving code segment to files via base64 urls.

Activity icon
issue

mrdoob issue mrdoob/glsl-sandbox

mrdoob
mrdoob

browser locking

You need to mark the examples that require heavy browser usage- Some examples cause the browser to lock up and you have to reset everything - not very useful....

Activity icon
issue

mrdoob issue mrdoob/glsl-sandbox

mrdoob
mrdoob

pause

A pause button.

  • because some heavy shaders can cause some browsers (safari) to become very unresponsive.

Possibly even better if pause button would be one that automatically pauses when rendering takes more than 500ms?

Activity icon
issue

mrdoob issue mrdoob/glsl-sandbox

mrdoob
mrdoob

Searchable Comments and User accounts

It would be pretty handy to be able to search through the comments section of the code for certain codes. This would make it easier to find codes made by certain artists.

The option to search through code would be nice too. For instance, the other day I was trying to find implementations of barrel distortion.

Having the option to sign in with a Sandbox user account (with maybe an optional link to social media sites) might ease this process a bit. It would also be nice to be able to leave comments on other peoples code some where other than in the code itself. If there existed some sort of comment board linked to each piece of code that would be sweet.

-Matt

Previous