<div dir="ltr">This sounds really cool. I hope to use my earth cutout example, with a solid earth instead of using "fake" techniques.<div><br></div><div>Thanks,</div><div><br></div><div>John</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 2, 2023 at 11:21 AM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Let me share that we found that it is possible to simulate<br>
differencing of shapes in x3dom to a useful degree. This allows for<br>
transparent cutouts or holes:<br>
<br>
<a href="https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/415d151abee114858c79c20c8c4b49e0/raw/4c70463321df267b28298462af76b869adbfdfdb/BoxWithHoles183.x3d" rel="noreferrer" target="_blank">https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/415d151abee114858c79c20c8c4b49e0/raw/4c70463321df267b28298462af76b869adbfdfdb/BoxWithHoles183.x3d</a><br>
<br>
The idea is to draw first transparent shapes which define the holes,<br>
including to the depth buffer. Then standard drawing of the solid<br>
shape will be hidden where the holes 'obscure' it (although the holes<br>
are actually transparent).<br>
<br>
To do that requires two changes to default rendering of transparent<br>
shapes. For best rendering normally transparent shapes are rendered<br>
last and do not write to the depth buffer. Here they are drawn first<br>
and do write to the depth buffer.<br>
<br>
In x3dom this is implemented by allowing explicit definition of the<br>
sort (rendering) order of shapes (with a sortKey field), and by<br>
allowing direct access to the gl depthmask function with a Depthmode<br>
node.<br>
<br>
An easy way to generate cutouts or holes which is otherwise only<br>
possible with external CSG tools is a powerful use case for these<br>
lower-level x3d extensions. Perhaps other browsers have similar<br>
features or are inspired to consider those.<br>
<br>
Andreas<br>
<br>
-- <br>
Andreas Plesch<br>
Waltham, MA 02453<br>
<br>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div>