meetar
meetar

Reputation: 7611

Three.js - get image dimensions and pass to fragment shader

I'm sending a bitmap as a uniform to a fragment shader with THREE.ImageUtils.loadTexture(). What's the simplest way for the fragment shader to access the size of the image in pixels?

Upvotes: 0

Views: 2836

Answers (1)

gaitat
gaitat

Reputation: 12642

Pass the values you want to the shader as uniforms.

Upvotes: 2

Related Questions