Textures
import { texture2d, uniformSampler2d, float, varyingVec2, Sampler2D, Vec2Node, attributes } from "@hology/core/shader-nodes"
import * as THREE from 'three'
const sampler: Sampler2D = uniformSampler2d('image')
const coord: Vec2Node = varyingVec2(attributes.uv)
const color: RgbaNode = texture2d(sampler, coord)
const texture = new THREE.TextureLoader().load( "path/to/texture.jpg" )
const material = new NodeShaderMaterial({
color: color,
uniforms: { image: { value: texture } }
})import { texture2d, textureSampler2d, float, varyingVec2, Sampler2D, Vec2Node, attributes } from "@hology/core/shader-nodes"
import * as THREE from 'three'
const texture = new THREE.TextureLoader().load( "path/to/texture.jpg" )
const sampler: Sampler2D = textureSampler2d(texture)
const coord: Vec2Node = varyingVec2(attributes.uv)
const color: RgbaNode = sampler.sample(coord)
const material = new NodeShaderMaterial({
color: color
})