OpenJSCAD.org icon indicating copy to clipboard operation
OpenJSCAD.org copied to clipboard

Improve regl-renderer to better reuse same geometry with different location or color

Open hrgdavor opened this issue 3 years ago • 1 comments

Expected Behavior

Fast change of colors on colorcube example at jscad

Actual Behavior

slower than expected

Steps to Reproduce the Problem

  1. load https://openjscad.xyz/?uri=https://openjscad.xyz/examples/core/colors/colorCube.js
  2. change parameters
  3. wait for update on screen

Specifications

The colorcube example will also likely benefit from #805

  • Version: V2
  • Platform: all
  • Environment: all

hrgdavor avatar Apr 22 '21 13:04 hrgdavor

The concept that can provide this is instancing and is only available in wegl2.

To implement at some point in regl-rendere maybe

  • new draw command is needed
  • code that groups geometries
  • a fallback to current method of drawing them when webgl2 is not supported

It may have too many obstacles in regl to implement, so it would have to be considered carefully before committing to do it.

hrgdavor avatar Aug 12 '21 20:08 hrgdavor