Skip to content

Instantly share code, notes, and snippets.

@kenjiSpecial
Last active March 13, 2017 12:49
Show Gist options
  • Select an option

  • Save kenjiSpecial/bfe3e3d3e11a94102cfbbd29154979ef to your computer and use it in GitHub Desktop.

Select an option

Save kenjiSpecial/bfe3e3d3e11a94102cfbbd29154979ef to your computer and use it in GitHub Desktop.
create render target
"use strict";
const THREE = require('THREE');
export function createRenderTarget(renderer){
let type = THREE.FloatType;
if( renderer.extensions.get('OES_texture_float_linear') == null) type = THREE.HalfFloatType;
let rt = new THREE.WebGLRenderTarget(1, 1, {
wrapS: THREE.ClampToEdgeWrapping,
wrapT: THREE.ClampToEdgeWrapping,
format: THREE.RGBAFormat,
type: type,
minFilter: THREE.NearestFilter,
magFilter: THREE.NearestFilter,
stencilBuffer: false,
depthBuffer: true
});
rt.texture.generateMipmaps = false;
return rt;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment