// WebGPU 를 지원하는 브라우저에서만 그립니다.
import { Shader, CarbonFiber } from 'shaders/react'
export default function ShaderEffect() {
return (
<Shader style={{ width: '100%', height: 320 }} disableTelemetry>
<CarbonFiber />
</Shader>
)
}
Vue
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<script setup lang="ts">
import { Shader, CarbonFiber } from 'shaders/vue'
</script>
<template>
<Shader style="width: 100%; height: 320px" :disable-telemetry="true">
<CarbonFiber/>
</Shader>
</template>
Svelte
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<script>
import { Shader, CarbonFiber } from 'shaders/svelte'
</script>
<Shader style="width: 100%; height: 320px" disableTelemetry>
<CarbonFiber />
</Shader>
Solid
// WebGPU 를 지원하는 브라우저에서만 그립니다.
import { Shader, CarbonFiber } from 'shaders/solid'
export default function ShaderEffect() {
return (
<Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
<CarbonFiber />
</Shader>
)
}
JavaScript
// WebGPU 를 지원하는 브라우저에서만 그립니다.
// <canvas id="canvas" style="width:100%;height:320px"></canvas> 가 페이지에 있어야 한다
import { createShader } from 'shaders/js'
const shader = await createShader(document.getElementById("canvas"), {
components: [
{
type: 'CarbonFiber',
}
]
}, { disableTelemetry: true })
속성(props) · CarbonFiber
값을 바꾸면 위 데모와 코드 탭에 바로 반영됩니다. 설명은 라이브러리 레지스트리의 영어 원문(MIT)입니다.
이름
값
기본값
범위·선택지
설명(원문)
originOrigin
코드에서 지정
center
—
Reference edge the center position is measured from (center default). Lets you pin the shape relative to a corner or the canvas centre.
centerCenter
xy
{"x":0.5,"y":0.5}
x, y: 0 – 1
Center position of the carbon shape
scaleScale
1
0.1 – 3 (step 0.01)
Scale of the carbon shape (1 = default size)
rotationRotation
0
0 – 360 (step 1)
Rotation of the carbon shape in degrees
lightColorFiber Sheen
#b9bdc6
—
The bright tone of the fibre sheen — recolor for forged/colored carbon (red, blue, bronze)
darkColorResin Color
#0b0c0e
—
The deep resin tone the weave falls to in shadow — near-black for classic carbon
weaveStyleWeave
twill
twill · plain
Weave pattern — plain (checkerboard) or 2×2 twill (the diagonal supercar weave)
weaveScaleWeave Scale
30
2 – 50 (step 0.5)
Number of woven tows across the shape — higher = finer, denser weave
weaveAngleWeave Angle
0
0 – 360 (step 1)
Rotates the whole weave grid in degrees
reliefWeave Depth
0.5
0 – 1 (step 0.01)
Depth of the quilted weave — how far each tow bulges, catching light on its crown and shadowing the valleys between
fiberSheenFiber Sheen
1.2
0 – 1.5 (step 0.01)
Strength of the anisotropic fibre sheen — the directional satin glint running along each tow
roughnessRoughness
0.5
0 – 1 (step 0.01)
Softness of the fibre sheen — 0 = tight crisp glints, 1 = soft matte satin
clearcoatClearcoat
1.2
0 – 2 (step 0.01)
Strength of the glossy lacquer coat — the sharp studio reflections of the wet clearcoat over the weave
environmentEnvironment
2
0 – 2 (step 0.01)
Strength of the reflected studio lighting seen in the clearcoat
envRotationEnv Rotation
0
0 – 360 (step 1)
Rotates the reflected studio — spins where the bright reflections fall
lightAngleLight Angle
215
0 – 360 (step 1)
Direction of the key light for the fibre sheen, in degrees
bevelWidthBevel Width
0.05
0.005 – 0.2 (step 0.001)
Width of the edge bevel, relative to the shape — thin for machined jewellery edges, wide for soft pillowed metal
bevelShapeBevel Profile
0
0 – 1 (step 0.01)
Bevel profile — 0 = one smooth round fillet, 1 = machined: a steep outer fillet, a chamfer plateau and an inner knee, each catching its own line of light
edgeSoftnessEdge Softness
0.05
0 – 1 (step 0.01)
Softness of the shape boundary edge
shapeShape
코드에서 지정
{"type":"sphere3D","radius":0.35}
—
Serialized shape configuration (JSON)
shapeSdfUrlshapeSdfUrl
코드에서 지정
—
URL to a pre-generated SDF .bin file
shapeTypeshapeType
코드에서 지정
—
Active SDF shape type
모든 컴포넌트 공통: blendMode · opacity · visible · maskSource/maskType · boundingBox · id