Skip to content

Commit 507b517

Browse files
fix: delete multisampling used in TresCanvas props (#188)
* fix: delete multisampling used in TresCanvas props * docs: clean demos (#189) * demos (>v2.0) cleaned and review * add suspense to introduction demo code * change language demo code, add highlights lines
1 parent c09851c commit 507b517

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+357
-403
lines changed

docs/.vitepress/theme/components/pmdrs/BarrelBlurDemo.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import '@tresjs/leches/styles'
1111
const gl = {
1212
clearColor: '#4f4f4f',
1313
toneMapping: NoToneMapping,
14-
multisampling: 8,
14+
}
15+
16+
const glComposer = {
17+
multisampling: 4,
1518
}
1619
1720
const { amount, offsetX, offsetY, blendFunction } = useControls({
@@ -21,7 +24,7 @@ const { amount, offsetX, offsetY, blendFunction } = useControls({
2124
blendFunction: {
2225
options: Object.keys(BlendFunction).map(key => ({
2326
text: key,
24-
value: BlendFunction[key],
27+
value: BlendFunction[key as keyof typeof BlendFunction],
2528
})),
2629
value: BlendFunction.OVERLAY,
2730
},
@@ -54,7 +57,7 @@ const { amount, offsetX, offsetY, blendFunction } = useControls({
5457
</RoundedBox>
5558

5659
<Suspense>
57-
<EffectComposerPmndrs>
60+
<EffectComposerPmndrs v-bind="glComposer">
5861
<BarrelBlurPmndrs :amount="amount" :offset="[offsetX, offsetY]" :blendFunction="Number(blendFunction)" />
5962
</EffectComposerPmndrs>
6063
</Suspense>

docs/.vitepress/theme/components/pmdrs/ChromaticAberrationDemo.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ import '@tresjs/leches/styles'
1313
const gl = {
1414
clearColor: '#ffffff',
1515
toneMapping: NoToneMapping,
16-
multisampling: 8,
16+
}
17+
18+
const glComposer = {
19+
multisampling: 4,
1720
}
1821
1922
const chromaticAberrationRef = shallowRef(null)
@@ -69,15 +72,16 @@ watchEffect(() => {
6972
/>
7073

7174
<Suspense>
72-
<EffectComposerPmndrs>
73-
<ChromaticAberrationPmndrs ref="chromaticAberrationRef" :offset="new Vector2(offsetX, offsetY)" :radial-modulation="radialModulation" :modulation-offset="modulationOffset" />
74-
</EffectComposerPmndrs>
75+
<Environment :intensity="2" :blur="0" preset="snow" />
7576
</Suspense>
7677

7778
<Suspense>
78-
<Environment :intensity="2" :blur="0" preset="snow" />
79+
<EffectComposerPmndrs v-bind="glComposer">
80+
<ChromaticAberrationPmndrs ref="chromaticAberrationRef" :offset="new Vector2(offsetX, offsetY)" :radial-modulation="radialModulation" :modulation-offset="modulationOffset" />
81+
</EffectComposerPmndrs>
7982
</Suspense>
8083
</TresCanvas>
8184
</div>
85+
8286
<TresLeches :float="false" />
8387
</template>

docs/.vitepress/theme/components/pmdrs/ColorAverageDemo.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ import '@tresjs/leches/styles'
1414
const gl = {
1515
clearColor: '#ffffff',
1616
toneMapping: NoToneMapping,
17-
multisampling: 8,
1817
envMapIntensity: 10,
1918
}
2019
20+
const glComposer = {
21+
multisampling: 4,
22+
}
23+
2124
const ctx = gsap.context(() => {})
2225
2326
const meshRef = ref<Mesh | null>(null)
@@ -26,7 +29,7 @@ const { blendFunction, opacity } = useControls({
2629
blendFunction: {
2730
options: Object.keys(BlendFunction).map(key => ({
2831
text: key,
29-
value: BlendFunction[key],
32+
value: BlendFunction[key as keyof typeof BlendFunction],
3033
})),
3134
value: BlendFunction.NORMAL,
3235
},
@@ -83,7 +86,7 @@ onUnmounted(() => {
8386
</Suspense>
8487

8588
<Suspense>
86-
<EffectComposerPmndrs>
89+
<EffectComposerPmndrs v-bind="glComposer">
8790
<ColorAveragePmndrs :blendFunction="Number(blendFunction)" :opacity="opacity" />
8891
</EffectComposerPmndrs>
8992
</Suspense>

docs/.vitepress/theme/components/pmdrs/DotScreenDemo.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import '@tresjs/leches/styles'
1212
const gl = {
1313
clearColor: '#ffffff',
1414
toneMapping: NoToneMapping,
15-
multisampling: 8,
15+
}
16+
17+
const glComposer = {
18+
multisampling: 4,
1619
}
1720
1821
const { angle, scale, blendFunction } = useControls({
@@ -21,7 +24,7 @@ const { angle, scale, blendFunction } = useControls({
2124
blendFunction: {
2225
options: Object.keys(BlendFunction).map(key => ({
2326
text: key,
24-
value: BlendFunction[key],
27+
value: BlendFunction[key as keyof typeof BlendFunction],
2528
})),
2629
value: BlendFunction.NORMAL,
2730
},
@@ -53,7 +56,7 @@ const { scene } = await useGLTF('https://raw.githubusercontent.com/Tresjs/assets
5356
</Suspense>
5457

5558
<Suspense>
56-
<EffectComposerPmndrs>
59+
<EffectComposerPmndrs v-bind="glComposer">
5760
<DotScreenPmndrs :blendFunction="Number(blendFunction)" :angle="angle" :scale="scale" />
5861
</EffectComposerPmndrs>
5962
</Suspense>

docs/.vitepress/theme/components/pmdrs/HueSaturationDemo.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import '@tresjs/leches/styles'
1111
1212
const gl = {
1313
toneMapping: NoToneMapping,
14-
multisampling: 8,
14+
}
15+
16+
const glComposer = {
17+
multisampling: 4,
1518
}
1619
1720
const { saturation, hue, blendFunction } = useControls({
@@ -20,7 +23,7 @@ const { saturation, hue, blendFunction } = useControls({
2023
blendFunction: {
2124
options: Object.keys(BlendFunction).map(key => ({
2225
text: key,
23-
value: BlendFunction[key],
26+
value: BlendFunction[key as keyof typeof BlendFunction],
2427
})),
2528
value: BlendFunction.SRC,
2629
},
@@ -48,7 +51,7 @@ const { saturation, hue, blendFunction } = useControls({
4851
</Suspense>
4952

5053
<Suspense>
51-
<EffectComposerPmndrs>
54+
<EffectComposerPmndrs v-bind="glComposer">
5255
<HueSaturationPmndrs :blendFunction="Number(blendFunction)" :hue="hue" :saturation="saturation" />
5356
</EffectComposerPmndrs>
5457
</Suspense>

docs/.vitepress/theme/components/pmdrs/KuwaharaDemo.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import '@tresjs/leches/styles'
1212
const gl = {
1313
clearColor: '#3386E0',
1414
toneMapping: NoToneMapping,
15-
multisampling: 8,
15+
}
16+
17+
const glComposer = {
18+
multisampling: 4,
1619
}
1720
1821
const { scene: scenePlantJar } = await useGLTF('https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/kuwahara-effect/plant-jar/plant-jar.glb', { draco: true })
@@ -70,8 +73,8 @@ watch(enabled, () => {
7073
</Suspense>
7174

7275
<Suspense>
73-
<EffectComposerPmndrs>
74-
<KuwaharaPmndrs :blendFunction="effectProps.blendFunction" :radius="radius" :sectorCount="sectorCount" />
76+
<EffectComposerPmndrs v-bind="glComposer">
77+
<KuwaharaPmndrs :blendFunction="Number(effectProps.blendFunction)" :radius="radius" :sectorCount="sectorCount" />
7578
</EffectComposerPmndrs>
7679
</Suspense>
7780
</TresCanvas>

docs/.vitepress/theme/components/pmdrs/LensDistortionDemo.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import '@tresjs/leches/styles'
99
1010
const gl = {
1111
toneMapping: NoToneMapping,
12-
multisampling: 8,
12+
}
13+
14+
const glComposer = {
15+
multisampling: 4,
1316
}
1417
1518
const { distortion, principalPoint, focalLength, skew } = useControls({
@@ -54,7 +57,7 @@ pbrTexture.map.colorSpace = SRGBColorSpace
5457
</Suspense>
5558

5659
<Suspense>
57-
<EffectComposerPmndrs>
60+
<EffectComposerPmndrs v-bind="glComposer">
5861
<LensDistortionPmndrs
5962
:distortion="distortion"
6063
:principalPoint="principalPoint"

docs/.vitepress/theme/components/pmdrs/LinocutDemo.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ import '@tresjs/leches/styles'
1111
const gl = {
1212
clearColor: '#00ff00',
1313
toneMapping: NoToneMapping,
14-
multisampling: 8,
1514
envMapIntensity: 10,
1615
}
1716
17+
const glComposer = {
18+
multisampling: 4,
19+
}
20+
1821
const { blendFunction, scale, noiseScale, centerX, centerY, rotation } = useControls({
1922
scale: { value: 0.85, step: 0.01, min: 0, max: 2 },
2023
noiseScale: { value: 0.0, step: 0.01, min: 0, max: 1 },
@@ -58,7 +61,7 @@ const { blendFunction, scale, noiseScale, centerX, centerY, rotation } = useCont
5861
/>
5962

6063
<Suspense>
61-
<EffectComposerPmndrs>
64+
<EffectComposerPmndrs v-bind="glComposer">
6265
<LinocutPmndrs
6366
:scale="scale"
6467
:noiseScale="noiseScale"

docs/.vitepress/theme/components/pmdrs/OutlineDemo.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import { useRouteDisposal } from '../../composables/useRouteDisposal'
1111
const gl = {
1212
clearColor: '#121212',
1313
toneMapping: NoToneMapping,
14-
multisampling: 8,
14+
}
15+
16+
const glComposer = {
17+
multisampling: 4,
1518
}
1619
1720
const { effectComposer } = useRouteDisposal()
@@ -58,7 +61,7 @@ const toggleMeshSelectionState = ({ object }: Intersection) => {
5861
:intensity="1"
5962
/>
6063
<Suspense>
61-
<EffectComposerPmndrs ref="effectComposer">
64+
<EffectComposerPmndrs ref="effectComposer" v-bind="glComposer">
6265
<OutlinePmndrs
6366
:outlined-objects="outlinedObjects"
6467
:edge-strength="200000"

docs/.vitepress/theme/components/pmdrs/ScanlineDemo.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import '@tresjs/leches/styles'
1111
const gl = {
1212
clearColor: '#000000',
1313
toneMapping: NoToneMapping,
14-
multisampling: 8,
14+
}
15+
16+
const glComposer = {
17+
multisampling: 4,
1518
}
1619
1720
const { blendFunction, opacity, density, scrollSpeed } = useControls({
@@ -21,7 +24,7 @@ const { blendFunction, opacity, density, scrollSpeed } = useControls({
2124
blendFunction: {
2225
options: Object.keys(BlendFunction).map(key => ({
2326
text: key,
24-
value: BlendFunction[key],
27+
value: BlendFunction[key as keyof typeof BlendFunction],
2528
})),
2629
value: BlendFunction.HARD_MIX,
2730
},
@@ -60,7 +63,7 @@ const { blendFunction, opacity, density, scrollSpeed } = useControls({
6063
<Stars />
6164

6265
<Suspense>
63-
<EffectComposerPmndrs>
66+
<EffectComposerPmndrs v-bind="glComposer">
6467
<ScanlinePmndrs :density="density" :opacity="opacity" :scrollSpeed="scrollSpeed" :blendFunction="Number(blendFunction)" />
6568
</EffectComposerPmndrs>
6669
</Suspense>

0 commit comments

Comments
 (0)