@@ -3,30 +3,35 @@ import { ContactShadows, Environment, OrbitControls } from '@tresjs/cientos'
33import { TresCanvas } from ' @tresjs/core'
44import { TresLeches , useControls } from ' @tresjs/leches'
55import { NoToneMapping } from ' three'
6- import { BlendFunction } from ' postprocessing'
6+ import { ASCIITexture , BlendFunction } from ' postprocessing'
77import { ASCIIPmndrs , EffectComposerPmndrs } from ' @tresjs/post-processing'
88
99import ' @tresjs/leches/styles'
1010
1111const gl = {
1212 clearColor: ' #ffffff' ,
1313 toneMapping: NoToneMapping ,
14- multisampling: 8 ,
1514}
1615
17- const { blendFunction, opacity, cellSize, inverted, color, useSceneColor } = useControls ({
16+ const { enabled, blendFunction, opacity, cellSize, inverted, color, useSceneColor, characters, font, fontSize, size, cellCount } = useControls ({
17+ enabled: true ,
1818 blendFunction: {
1919 options: Object .keys (BlendFunction ).map (key => ({
2020 text: key ,
2121 value: BlendFunction [key as keyof typeof BlendFunction ],
2222 })),
23- value: BlendFunction .OVERLAY ,
23+ value: BlendFunction .NORMAL ,
2424 },
2525 opacity: { value: 1 , step: 0.1 , min: 0.0 , max: 1.0 },
2626 cellSize: { value: 12 , step: 1 , min: 2 , max: 64 },
2727 useSceneColor: false ,
28- color: ' #ff0000 ' ,
28+ color: ' #ffffff ' ,
2929 inverted: false ,
30+ characters: { value: ' @#8&$%*o!;.' , label: ' Characters' },
31+ font: { value: ' Arial' , label: ' Font' },
32+ fontSize: { value: 54 , step: 1 , min: 10 , max: 100 , label: ' Font Size' },
33+ size: { value: 1024 , step: 128 , min: 256 , max: 2048 , label: ' Texture Size' },
34+ cellCount: { value: 16 , step: 1 , min: 4 , max: 64 , label: ' Cell Count' },
3035})
3136 </script >
3237
@@ -37,34 +42,36 @@ const { blendFunction, opacity, cellSize, inverted, color, useSceneColor } = use
3742 v-bind =" gl"
3843 >
3944 <TresPerspectiveCamera
40- :position =" [5, 5, 5]"
45+ :position =" [5, 6. 5, 7. 5]"
4146 :look-at =" [0, 0, 0]"
4247 />
4348 <OrbitControls auto-rotate />
4449
4550 <TresMesh :position =" [0, .5, 0]" >
4651 <TresBoxGeometry :args =" [2, 2, 2]" />
47- <TresMeshPhysicalMaterial color =" black " :roughness = " .25 " />
52+ <TresMeshPhysicalMaterial color =" white " />
4853 </TresMesh >
4954
50- <ContactShadows
51- :opacity =" 1"
52- :position-y =" -.5"
53- />
54-
5555 <Suspense >
56- <Environment background :blur = " .5 " preset =" night " />
56+ <Environment background preset =" dawn " />
5757 </Suspense >
5858
5959 <Suspense >
6060 <EffectComposerPmndrs >
6161 <ASCIIPmndrs
62- :blendFunction =" Number(blendFunction)"
62+ :blendFunction =" enabled ? Number(blendFunction) : Number(BlendFunction.SKIP )"
6363 :opacity =" opacity"
6464 :cellSize =" cellSize"
6565 :inverted =" inverted"
6666 :color =" color"
6767 :useSceneColor =" useSceneColor"
68+ :asciiTexture =" {
69+ characters,
70+ font,
71+ fontSize,
72+ size,
73+ cellCount,
74+ }"
6875 />
6976 </EffectComposerPmndrs >
7077 </Suspense >
0 commit comments