GhGL questions / feature request

Hi @stevebaer, @everyone

I’m finally learning the darkest magic, so thanks for this plugin!

Some questions:

  1. I can’t see a way to measure the distance from a 3d point to the closest geometry. Do you have some idea? An efficient method would open the door to raytracing beyond the SDF approach. Do you think this will be possible?

  2. Why GLBuiltInShader component is not show in the components ribbon?

Here are some feature request:

  1. _colorBuffer and _depthBuffer are great but I am wondering if you can include some more.

  2. _previousColorBuffer as the https://github.com/mcneel/ghgl/pull/40 suggest (I haven’t tried but I used a lot this feature learning OpenGL).

  3. _indexBuffer: a segmentation map to index geometries, as a sampler2D to know which index is hitting the pixel ray.

  4. _normalBuffer: instead of getting the color as in _colorBuffer, getting the normal direction at each pixel coordinate

  5. _distBuffer: similar to _depthBuffer but with real distance from clip to object.

  6. Support for sampler3D for volumetric materials and samplerCube to easy make cubic based environments.

1 is the most important issue, 5. and 4. would be great to have, the others are less important.

Thanks.

1 Like

That component is for internal McNeel development. We pass in some specific strings to it to allow us to edit existing shaders built into core rhino. These shaders are not open source.

This is not an easy task by any means. You would need to figure out a way to encode geometry and place it as data on the gpu so a pixel shader could access it. Basically, this is what gpu accelerated raytracers do and is not something the GhGL does for you.