How to use the RGBFormat function from three

Find comprehensive JavaScript three.RGBFormat code examples handpicked from public code repositorys.

56
57
58
59
60
61
62
63
64
65

var reflectionCube = THREE.ImageUtils.loadTextureCube( urls );
reflectionCube.format = THREE.RGBFormat;

var refractionCube = new THREE.Texture( reflectionCube.image, new THREE.CubeRefractionMapping() );
refractionCube.format = THREE.RGBFormat;

var r = 10;
var sphereGeo = new THREE.SphereGeometry(r, 50, 50);
var colors = [
fork icon2
star icon51
watch icon7

+ 3 other calls in file

1835
1836
1837
1838
1839
1840
1841
1842
1843
    case "aoMap":
    case "emissiveMap":
    case "metalnessMap":
    case "normalMap":
    case "roughnessMap":
      texture.format = THREE.RGBFormat;
      break;
  }
}
fork icon3
star icon7
watch icon8

+ 14 other calls in file

174
175
176
177
178
179
180
181
182
183
  image_base_path + "posx.jpg", image_base_path + "negx.jpg",
  image_base_path + "posy.jpg", image_base_path + "negy.jpg",
  image_base_path + "posz.jpg", image_base_path + "negz.jpg" 
];
textureCube = new THREE.CubeTextureLoader().load( urls );
textureCube.format = THREE.RGBFormat;
textureCube.mapping = THREE.CubeReflectionMapping;
textureCube.encoding = THREE.sRGBEncoding;

var cubeShader = THREE.ShaderLib[ "cube" ];
fork icon75
star icon0
watch icon1

252
253
254
255
256
257
258
259
260
261
geometry.computeBoundingSphere();

var videoTexture = new THREE.VideoTexture(video);
videoTexture.minFilter = THREE.NearestFilter;
videoTexture.magFilter = THREE.NearestFilter;
videoTexture.format = THREE.RGBFormat;
videoTexture.flipY = false;

// The material is different if the see through camera is provided inside the vrDisplay or not.
var material;
fork icon0
star icon2
watch icon0

1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
}

texture.flipY = false;
if (textureDef.name) texture.name = textureDef.name; // When there is definitely no alpha channel in the texture, set RGBFormat to save space.

if (!hasAlpha) texture.format = _three.RGBFormat;
var samplers = json.samplers || {};
var sampler = samplers[textureDef.sampler] || {};
texture.magFilter = WEBGL_FILTERS[sampler.magFilter] || _three.LinearFilter;
texture.minFilter = WEBGL_FILTERS[sampler.minFilter] || _three.LinearMipmapLinearFilter;
fork icon0
star icon1
watch icon0

1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
// an image canvas is used

this.videoTexture.generateMipmaps = false;
this.videoTexture.minFilter = THREE.LinearFilter;
this.videoTexture.magFilter = THREE.LinearFilter;
this.videoTexture.format = THREE.RGBFormat;
this.changeProjection_(this.currentProjection_);

if (this.currentProjection_ === 'NONE') {
  this.log('Projection is NONE, dont init');
fork icon0
star icon0
watch icon1

+ 20 other calls in file

40
41
42
43
44
45
46
47
48
    }
},

createSkyBox: function (scene, urls, size) {
    let skyboxCubemap = new THREE.CubeTextureLoader().load(urls);
    skyboxCubemap.format = THREE.RGBFormat;

    let skyboxShader = THREE.ShaderLib['cube'];
    skyboxShader.uniforms['tCube'].value = skyboxCubemap;
fork icon0
star icon0
watch icon0

7
8
9
10
11
12
13
14
15
16
17
} from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
import "./App.css";
extend({ OrbitControls });
const THREE = require('three');
const format = THREE.RGBFormat;


const CameraControls = () => {
  const {
    camera,
fork icon0
star icon0
watch icon0

+ 6 other calls in file

516
517
518
519
520
521
522
523
524

  }

  // standard
  var envMap = new THREE.CubeTextureLoader().load(cubeMapURLs);
  envMap.format = THREE.RGBFormat;
  return Promise.resolve(envMap);

}
fork icon0
star icon0
watch icon0

+ 5 other calls in file

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)