Skip to content

Commit

Permalink
Merge pull request #174 from immersive-web/revert-171-video
Browse files Browse the repository at this point in the history
Revert "Add occlusion sample"
  • Loading branch information
cabanier committed Jan 8, 2024
2 parents 2544b7d + 322631d commit 4a5df35
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 828 deletions.
28 changes: 4 additions & 24 deletions js/render/core/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import {CAP, MAT_STATE, RENDER_ORDER, stateToBlendFunc} from './material.js';
import {Node} from './node.js';
import {Program} from './program.js';
import {DataTexture, ExternalTexture, VideoTexture} from './texture.js';
import {DataTexture, VideoTexture} from './texture.js';
import {mat4, vec3} from '../math/gl-matrix.js';

export const ATTRIB = {
Expand Down Expand Up @@ -150,10 +150,6 @@ export class RenderView {
get eyeIndex() {
return this._eyeIndex;
}

set depthTexture(value) {
this._depthTexture = value;
}
}

class RenderBuffer {
Expand Down Expand Up @@ -317,8 +313,6 @@ export class RenderTexture {
this._complete = false;
this._activeFrameId = 0;
this._activeCallback = null;
this._isExternalTexture = false;
this._isArray = false;
}

markActive(frameId) {
Expand Down Expand Up @@ -441,13 +435,11 @@ class RenderMaterial {
}

for (let sampler of this._samplers) {
let type = sampler._renderTexture._isArray ? gl.TEXTURE_2D_ARRAY : gl.TEXTURE_2D;

gl.activeTexture(gl.TEXTURE0 + sampler._index);
if (sampler._renderTexture && sampler._renderTexture._complete) {
gl.bindTexture(type, sampler._renderTexture._texture);
gl.bindTexture(gl.TEXTURE_2D, sampler._renderTexture._texture);
} else {
gl.bindTexture(type, null);
gl.bindTexture(gl.TEXTURE_2D, null);
}
}

Expand Down Expand Up @@ -795,15 +787,6 @@ export class Renderer {
}
}

addExternalTexture(key, texture, isArray) {
if (this._textureCache[key] === 'undefined') {
this._textureCache[key] = {};
}
this._textureCache[key]._complete = true;
this._textureCache[key]._texture = texture;
this._textureCache[key]._isArray = isArray;
}

_getRenderTexture(texture) {
if (!texture) {
return null;
Expand All @@ -823,9 +806,7 @@ export class Renderer {
let renderTexture = new RenderTexture(textureHandle);
this._textureCache[key] = renderTexture;

if (texture instanceof ExternalTexture) {
renderTexture._isExternalTexture = true;
} else if (texture instanceof DataTexture) {
if (texture instanceof DataTexture) {
gl.bindTexture(gl.TEXTURE_2D, textureHandle);
gl.texImage2D(gl.TEXTURE_2D, 0, texture.format, texture.width, texture.height,
0, texture.format, texture._type, texture._data);
Expand Down Expand Up @@ -890,7 +871,6 @@ export class Renderer {
_getMaterialProgram(material, renderPrimitive) {
const multiview = this._multiview;
let materialName = material.materialName;
material.useDepth = this.useDepth;
let vertexSource = (!multiview) ? material.vertexSource : material.vertexSourceMultiview;
let fragmentSource = (!multiview) ? material.fragmentSource : material.fragmentSourceMultiview;

Expand Down
20 changes: 0 additions & 20 deletions js/render/core/texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ export class Texture {
get textureKey() {
return null;
}

get isExternal() {
return false;
}
}

export class ImageTexture extends Texture {
Expand Down Expand Up @@ -212,22 +208,6 @@ export class DataTexture extends Texture {
}
}

export class ExternalTexture extends Texture {
constructor(key) {
super();

this._key = key;
}

get textureKey() {
return this._key;
}

get isExternal() {
return true;
}
}

export class ColorTexture extends DataTexture {
constructor(r, g, b, a) {
let colorData = new Uint8Array([r*255.0, g*255.0, b*255.0, a*255.0]);
Expand Down
Loading

0 comments on commit 4a5df35

Please sign in to comment.