mrdoob/three.js — Issue #787: Maps in ShaderMaterial don't respect wrapS/wrapT?
Author: mway
Created: 2011-11-23 00:58:05+00:00
State: open

Sorry in advance if this is due to my lack of understanding - just jumping into webgl/three.js now (loving three.js).

I'm running into a problem with uniform textures. I'm loading textures for normal/diffuse/displacement/specular maps in the shader uniform object, as well as a texture cube for the reflection map. When I load each of these textures I explicitly set `wrapS`/`wrapT` to be `THREE.RepeatWrapping`, and then afterward create a new `THREE.ShaderMaterial` based on that shader/uniforms.

When I create the mesh with the geometry and the material though, none of the textures are repeating (so I have some tearing where small parts of the object are only colored by ambient light). If I create the mesh with `geometry.materials[0]` instead, the `wrapS`/`wrapT` work as expected, but obviously I lose the normal/spec/etc maps (left only with diffuse, so it's basically a flat object).

Is it possible to have the ShaderMaterial repeat properly so that I can maintain all of the maps?