Browse Source

docs: added contact shadows to post

alvarosabu 2 năm trước cách đây
mục cha
commit
ffa7bdae66
1 tập tin đã thay đổi với 28 bổ sung0 xóa
  1. 28 0
      docs/blog/announcing-v-2-1-0.md

+ 28 - 0
docs/blog/announcing-v-2-1-0.md

@@ -95,3 +95,31 @@ This was highly requested by the community, so thanks to everyone that contribut
   </TresCanvas>
 </template>
 ```
+
+#### Welcome `ContactShadows`
+
+![Contact Shadows](https://cientos.tresjs.org/cientos/contact-shadows.png)
+
+We have added support for [Contact Shadows](https://threejs.org/examples/?q=cont#webgl_shadow_contact). Is a technique used in 3D graphics to create shadows that appear where objects meet or "contact" each other. This is different from traditional shadowing techniques, which often only create shadows based on the position of a light source relative to an object.
+
+```html {11}
+<template>
+  <TresCanvas v-bind="gl">
+    <TresPerspectiveCamera :position="[11, 11, 11]" />
+    <OrbitControls />
+    <Box ref="boxRef" :args="[0.4, 0.4, 0.4]" :position="[0, 1, 0]">
+      <TresMeshNormalMaterial />
+    </Box>
+    <Icosahedron ref="icoRef" :args="[0.3]" :position="[1, 1, 1]">
+      <TresMeshNormalMaterial />
+    </Icosahedron>
+    <ContactShadows :blur="0.5" :resolution="512" :opacity="0.2" />
+    <Plane :args="[10, 10, 10]" :position="[0, -0.02, 0]">
+      <TresMeshBasicMaterial :color="'#ffffff'" />
+    </Plane>
+    <TresAmbientLight :intensity="1" />
+  </TresCanvas>
+</template>
+```
+
+### Precipitation abstraction