提交 55d8619a 编写于 作者: D David Peicho

texture3D: add support for TEXTURE_WRAP_R

上级 76e6d920
......@@ -66,6 +66,7 @@ function glconstants() {
TEXTURE_MIN_FILTER: 10241,
TEXTURE_WRAP_S: 10242,
TEXTURE_WRAP_T: 10243,
TEXTURE_WRAP_R: 32882,
REPEAT: 10497,
COLOR_BUFFER_BIT: 16384,
FUNC_ADD: 32774,
......
......@@ -434,6 +434,12 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, utils.convert( texture.wrapS ) );
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, utils.convert( texture.wrapT ) );
if ( textureType === _gl.TEXTURE_3D ) {
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_R, utils.convert( texture.wrapR ) );
}
_gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, utils.convert( texture.magFilter ) );
_gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, utils.convert( texture.minFilter ) );
......@@ -442,6 +448,12 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE );
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE );
if ( textureType === _gl.TEXTURE_3D ) {
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_R, _gl.CLAMP_TO_EDGE );
}
if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) {
console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.' );
......
......@@ -3,7 +3,7 @@
*/
import { Texture } from './Texture.js';
import { NearestFilter } from '../constants.js';
import { ClampToEdgeWrapping, NearestFilter } from '../constants.js';
function DataTexture3D( data, width, height, depth ) {
......@@ -22,6 +22,8 @@ function DataTexture3D( data, width, height, depth ) {
this.magFilter = NearestFilter;
this.minFilter = NearestFilter;
this.wrapR = ClampToEdgeWrapping;
this.generateMipmaps = false;
this.flipY = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册