mirror of
https://github.com/FMS-Cat/condition.git
synced 2025-08-10 07:54:09 +02:00
fix: dummyRenderTargetOneDrawBuffers was wrong
This commit is contained in:
@@ -9,7 +9,7 @@ import bloomPreFrag from '../shaders/bloom-pre.frag';
|
|||||||
import bloomBlurFrag from '../shaders/bloom-blur.frag';
|
import bloomBlurFrag from '../shaders/bloom-blur.frag';
|
||||||
import bloomPostFrag from '../shaders/bloom-post.frag';
|
import bloomPostFrag from '../shaders/bloom-post.frag';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
import { Blit } from '../heck/components/Blit';
|
import { Blit } from '../heck/components/Blit';
|
||||||
import { gl } from '../globals/canvas';
|
import { gl } from '../globals/canvas';
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ export class Bloom extends Entity {
|
|||||||
const materialBloomPre = new Material(
|
const materialBloomPre = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
bloomPreFrag,
|
bloomPreFrag,
|
||||||
{ initOptions: { target: dummyRenderTargetOneDrawBuffers, geometry: quadGeometry } },
|
{ initOptions: { target: dummyRenderTarget, geometry: quadGeometry } },
|
||||||
);
|
);
|
||||||
materialBloomPre.addUniformTexture( 'sampler0', options.input.texture );
|
materialBloomPre.addUniformTexture( 'sampler0', options.input.texture );
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ export class Bloom extends Entity {
|
|||||||
const material = new Material(
|
const material = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
bloomBlurFrag,
|
bloomBlurFrag,
|
||||||
{ initOptions: { target: dummyRenderTargetOneDrawBuffers, geometry: quadGeometry } },
|
{ initOptions: { target: dummyRenderTarget, geometry: quadGeometry } },
|
||||||
);
|
);
|
||||||
material.addUniform( 'isVert', '1i', i );
|
material.addUniform( 'isVert', '1i', i );
|
||||||
material.addUniformTexture( 'sampler0', swap.i.texture );
|
material.addUniformTexture( 'sampler0', swap.i.texture );
|
||||||
@@ -90,7 +90,7 @@ export class Bloom extends Entity {
|
|||||||
const materialBloomPost = new Material(
|
const materialBloomPost = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
bloomPostFrag,
|
bloomPostFrag,
|
||||||
{ initOptions: { target: dummyRenderTargetOneDrawBuffers, geometry: quadGeometry } },
|
{ initOptions: { target: dummyRenderTarget, geometry: quadGeometry } },
|
||||||
);
|
);
|
||||||
materialBloomPost.addUniformTexture( 'samplerDry', options.input.texture );
|
materialBloomPost.addUniformTexture( 'samplerDry', options.input.texture );
|
||||||
materialBloomPost.addUniformTexture( 'samplerWet', swap.i.texture );
|
materialBloomPost.addUniformTexture( 'samplerWet', swap.i.texture );
|
||||||
|
@@ -14,7 +14,7 @@ import shadingFrag from '../shaders/shading.frag';
|
|||||||
import { gl } from '../globals/canvas';
|
import { gl } from '../globals/canvas';
|
||||||
import { randomTexture } from '../globals/randomTexture';
|
import { randomTexture } from '../globals/randomTexture';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
export interface CameraEntityOptions {
|
export interface CameraEntityOptions {
|
||||||
root: Entity;
|
root: Entity;
|
||||||
@@ -58,7 +58,7 @@ export class CameraEntity extends Entity {
|
|||||||
const aoMaterial = new Material(
|
const aoMaterial = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
aoFrag,
|
aoFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
|
|
||||||
this.components.push( new Lambda( {
|
this.components.push( new Lambda( {
|
||||||
@@ -100,7 +100,7 @@ export class CameraEntity extends Entity {
|
|||||||
defines: {
|
defines: {
|
||||||
IS_FIRST_LIGHT: iLight === 0 ? 'true' : undefined
|
IS_FIRST_LIGHT: iLight === 0 ? 'true' : undefined
|
||||||
},
|
},
|
||||||
initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers },
|
initOptions: { geometry: quadGeometry, target: dummyRenderTarget },
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@ import { createSVGTableTexture } from '../utils/createSVGTableTexture';
|
|||||||
import conditionVert from '../shaders/condition.vert';
|
import conditionVert from '../shaders/condition.vert';
|
||||||
import conditionFrag from '../shaders/condition.frag';
|
import conditionFrag from '../shaders/condition.frag';
|
||||||
import { Material } from '../heck/Material';
|
import { Material } from '../heck/Material';
|
||||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
import { Mesh } from '../heck/components/Mesh';
|
import { Mesh } from '../heck/components/Mesh';
|
||||||
import { auto } from '../globals/automaton';
|
import { auto } from '../globals/automaton';
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ export class Condition extends Entity {
|
|||||||
conditionFrag,
|
conditionFrag,
|
||||||
{
|
{
|
||||||
defines: { 'FORWARD': 'true' },
|
defines: { 'FORWARD': 'true' },
|
||||||
initOptions: { geometry, target: dummyRenderTargetOneDrawBuffers },
|
initOptions: { geometry, target: dummyRenderTarget },
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
deferred: new Material(
|
deferred: new Material(
|
||||||
@@ -123,7 +123,7 @@ export class Condition extends Entity {
|
|||||||
conditionFrag,
|
conditionFrag,
|
||||||
{
|
{
|
||||||
defines: { 'SHADOW': 'true' },
|
defines: { 'SHADOW': 'true' },
|
||||||
initOptions: { geometry, target: dummyRenderTargetOneDrawBuffers },
|
initOptions: { geometry, target: dummyRenderTarget },
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
@@ -8,7 +8,7 @@ import { gl, glCat } from '../globals/canvas';
|
|||||||
import { Vector3 } from '@fms-cat/experimental';
|
import { Vector3 } from '@fms-cat/experimental';
|
||||||
import { GLCatTexture } from '@fms-cat/glcat-ts';
|
import { GLCatTexture } from '@fms-cat/glcat-ts';
|
||||||
import { auto } from '../globals/automaton';
|
import { auto } from '../globals/automaton';
|
||||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
const POINTS_MAX = 256;
|
const POINTS_MAX = 256;
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ export class ConditionChar extends Entity {
|
|||||||
conditionCharFrag,
|
conditionCharFrag,
|
||||||
{
|
{
|
||||||
defines: { 'FORWARD': 'true' },
|
defines: { 'FORWARD': 'true' },
|
||||||
initOptions: { geometry, target: dummyRenderTargetOneDrawBuffers },
|
initOptions: { geometry, target: dummyRenderTarget },
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
deferred: new Material(
|
deferred: new Material(
|
||||||
@@ -86,7 +86,7 @@ export class ConditionChar extends Entity {
|
|||||||
conditionCharFrag,
|
conditionCharFrag,
|
||||||
{
|
{
|
||||||
defines: { 'SHADOW': 'true' },
|
defines: { 'SHADOW': 'true' },
|
||||||
initOptions: { geometry, target: dummyRenderTargetOneDrawBuffers },
|
initOptions: { geometry, target: dummyRenderTarget },
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
@@ -9,7 +9,7 @@ import depthFrag from '../shaders/depth.frag';
|
|||||||
import { genCube } from '../geometries/genCube';
|
import { genCube } from '../geometries/genCube';
|
||||||
import { Lambda } from '../heck/components/Lambda';
|
import { Lambda } from '../heck/components/Lambda';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
export class Cube extends Entity {
|
export class Cube extends Entity {
|
||||||
public mesh: Mesh;
|
public mesh: Mesh;
|
||||||
@@ -55,7 +55,7 @@ export class Cube extends Entity {
|
|||||||
shadow: new Material(
|
shadow: new Material(
|
||||||
cubeVert,
|
cubeVert,
|
||||||
depthFrag,
|
depthFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@ import { CubemapRenderTarget } from '../heck/CubemapRenderTarget';
|
|||||||
import { gl } from '../globals/canvas';
|
import { gl } from '../globals/canvas';
|
||||||
import { auto } from '../globals/automaton';
|
import { auto } from '../globals/automaton';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
const WIDTH = 1024;
|
const WIDTH = 1024;
|
||||||
const HEIGHT = 512;
|
const HEIGHT = 512;
|
||||||
@@ -50,7 +50,7 @@ export class EnvironmentMap extends Entity {
|
|||||||
const materialIntegrate = new Material(
|
const materialIntegrate = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
environmentMapFrag,
|
environmentMapFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
materialIntegrate.addUniform( 'uniformSeed', '4f', rng.gen(), rng.gen(), rng.gen(), rng.gen() );
|
materialIntegrate.addUniform( 'uniformSeed', '4f', rng.gen(), rng.gen(), rng.gen(), rng.gen() );
|
||||||
materialIntegrate.addUniformTexture( 'sampler0', swap.i.texture );
|
materialIntegrate.addUniformTexture( 'sampler0', swap.i.texture );
|
||||||
@@ -76,7 +76,7 @@ export class EnvironmentMap extends Entity {
|
|||||||
const materialMerge = new Material(
|
const materialMerge = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
environmentMapMergeFrag,
|
environmentMapMergeFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
materialMerge.addUniformTexture( 'sampler0', swap.i.texture );
|
materialMerge.addUniformTexture( 'sampler0', swap.i.texture );
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ import { TRIANGLE_STRIP_QUAD } from '@fms-cat/experimental';
|
|||||||
import { gl, glCat } from '../globals/canvas';
|
import { gl, glCat } from '../globals/canvas';
|
||||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
const PARTICLES_SQRT = 8;
|
const PARTICLES_SQRT = 8;
|
||||||
const PARTICLES = PARTICLES_SQRT * PARTICLES_SQRT;
|
const PARTICLES = PARTICLES_SQRT * PARTICLES_SQRT;
|
||||||
@@ -23,7 +23,7 @@ export class FlickyParticles extends Entity {
|
|||||||
const materialCompute = new Material(
|
const materialCompute = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
flickyParticleComputeFrag,
|
flickyParticleComputeFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
|
|
||||||
materialCompute.addUniform( 'particlesSqrt', '1f', PARTICLES_SQRT );
|
materialCompute.addUniform( 'particlesSqrt', '1f', PARTICLES_SQRT );
|
||||||
@@ -73,7 +73,7 @@ export class FlickyParticles extends Entity {
|
|||||||
flickyParticleRenderFrag,
|
flickyParticleRenderFrag,
|
||||||
{
|
{
|
||||||
defines: { 'FORWARD': 'true' },
|
defines: { 'FORWARD': 'true' },
|
||||||
initOptions: { geometry: geometryRender, target: dummyRenderTargetOneDrawBuffers },
|
initOptions: { geometry: geometryRender, target: dummyRenderTarget },
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ export class FlickyParticles extends Entity {
|
|||||||
flickyParticleRenderFrag,
|
flickyParticleRenderFrag,
|
||||||
{
|
{
|
||||||
defines: { 'SHADOW': 'true' },
|
defines: { 'SHADOW': 'true' },
|
||||||
initOptions: { geometry: geometryRender, target: dummyRenderTargetOneDrawBuffers },
|
initOptions: { geometry: geometryRender, target: dummyRenderTarget },
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@ import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
|||||||
import { Blit } from '../heck/components/Blit';
|
import { Blit } from '../heck/components/Blit';
|
||||||
import { auto } from '../globals/automaton';
|
import { auto } from '../globals/automaton';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
export interface GlitchOptions {
|
export interface GlitchOptions {
|
||||||
input: BufferRenderTarget;
|
input: BufferRenderTarget;
|
||||||
@@ -42,7 +42,7 @@ export class Glitch extends Entity {
|
|||||||
this.material = new Material(
|
this.material = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
glitchFrag,
|
glitchFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
this.material.addUniformTexture( 'sampler0', options.input.texture );
|
this.material.addUniformTexture( 'sampler0', options.input.texture );
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@ import { Swap } from '@fms-cat/experimental';
|
|||||||
import { Lambda } from '../heck/components/Lambda';
|
import { Lambda } from '../heck/components/Lambda';
|
||||||
import { vdc } from '../utils/vdc';
|
import { vdc } from '../utils/vdc';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
const IBL_SIZE = 256;
|
const IBL_SIZE = 256;
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ export class IBLLUT {
|
|||||||
const material = new Material(
|
const material = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
iblLutFrag,
|
iblLutFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
material.addUniform( 'samples', '1f', samples );
|
material.addUniform( 'samples', '1f', samples );
|
||||||
material.addUniform( 'vdc', '1f', vdc( samples, 2.0 ) );
|
material.addUniform( 'vdc', '1f', vdc( samples, 2.0 ) );
|
||||||
|
@@ -7,7 +7,7 @@ import { Swap } from '@fms-cat/experimental';
|
|||||||
import quadVert from '../shaders/quad.vert';
|
import quadVert from '../shaders/quad.vert';
|
||||||
import shadowBlurFrag from '../shaders/shadow-blur.frag';
|
import shadowBlurFrag from '../shaders/shadow-blur.frag';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
export interface LightEntityOptions {
|
export interface LightEntityOptions {
|
||||||
root: Entity;
|
root: Entity;
|
||||||
@@ -76,7 +76,7 @@ export class LightEntity extends Entity {
|
|||||||
const material = new Material(
|
const material = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
shadowBlurFrag,
|
shadowBlurFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
material.addUniform( 'isVert', '1i', i );
|
material.addUniform( 'isVert', '1i', i );
|
||||||
material.addUniformTexture( 'sampler0', swap.i.texture );
|
material.addUniformTexture( 'sampler0', swap.i.texture );
|
||||||
|
@@ -10,7 +10,7 @@ import { Swap } from '@fms-cat/experimental';
|
|||||||
import { Blit } from '../heck/components/Blit';
|
import { Blit } from '../heck/components/Blit';
|
||||||
import { auto } from '../globals/automaton';
|
import { auto } from '../globals/automaton';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
export interface PixelSorterOptions {
|
export interface PixelSorterOptions {
|
||||||
input: BufferRenderTarget;
|
input: BufferRenderTarget;
|
||||||
@@ -69,7 +69,7 @@ export class PixelSorter extends Entity {
|
|||||||
const material = new Material(
|
const material = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
pixelSorterIndexFrag,
|
pixelSorterIndexFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
material.addUniform( 'mul', '1f', mul );
|
material.addUniform( 'mul', '1f', mul );
|
||||||
material.addUniformTexture(
|
material.addUniformTexture(
|
||||||
@@ -104,7 +104,7 @@ export class PixelSorter extends Entity {
|
|||||||
const material = new Material(
|
const material = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
pixelSorterFrag,
|
pixelSorterFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
material.addUniform( 'dir', '1f', dir );
|
material.addUniform( 'dir', '1f', dir );
|
||||||
material.addUniform( 'comp', '1f', comp );
|
material.addUniform( 'comp', '1f', comp );
|
||||||
|
@@ -6,7 +6,7 @@ import postFrag from '../shaders/post.frag';
|
|||||||
import quadVert from '../shaders/quad.vert';
|
import quadVert from '../shaders/quad.vert';
|
||||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
export interface PostOptions {
|
export interface PostOptions {
|
||||||
input: BufferRenderTarget;
|
input: BufferRenderTarget;
|
||||||
@@ -23,7 +23,7 @@ export class Post extends Entity {
|
|||||||
const material = new Material(
|
const material = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
postFrag,
|
postFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
material.addUniformTexture( 'sampler0', options.input.texture );
|
material.addUniformTexture( 'sampler0', options.input.texture );
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@ import raymarcherFrag from '../shaders/raymarcher.frag';
|
|||||||
import { Lambda } from '../heck/components/Lambda';
|
import { Lambda } from '../heck/components/Lambda';
|
||||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||||
import { auto } from '../globals/automaton';
|
import { auto } from '../globals/automaton';
|
||||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
import { genOctahedron } from '../geometries/genOctahedron';
|
import { genOctahedron } from '../geometries/genOctahedron';
|
||||||
|
|
||||||
export class Raymarcher extends Entity {
|
export class Raymarcher extends Entity {
|
||||||
@@ -45,7 +45,7 @@ export class Raymarcher extends Entity {
|
|||||||
raymarcherFrag,
|
raymarcherFrag,
|
||||||
{
|
{
|
||||||
defines: { 'SHADOW': 'true' },
|
defines: { 'SHADOW': 'true' },
|
||||||
initOptions: { geometry, target: dummyRenderTargetOneDrawBuffers }
|
initOptions: { geometry, target: dummyRenderTarget }
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
@@ -9,7 +9,7 @@ import ringsVert from '../shaders/rings.vert';
|
|||||||
import ringsFrag from '../shaders/rings.frag';
|
import ringsFrag from '../shaders/rings.frag';
|
||||||
import { gl, glCat } from '../globals/canvas';
|
import { gl, glCat } from '../globals/canvas';
|
||||||
import { Lambda } from '../heck/components/Lambda';
|
import { Lambda } from '../heck/components/Lambda';
|
||||||
import { dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
const PRIMCOUNT = 32;
|
const PRIMCOUNT = 32;
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ export class Rings extends Entity {
|
|||||||
ringsFrag,
|
ringsFrag,
|
||||||
{
|
{
|
||||||
defines: { 'FORWARD': 'true' },
|
defines: { 'FORWARD': 'true' },
|
||||||
initOptions: { geometry, target: dummyRenderTargetOneDrawBuffers },
|
initOptions: { geometry, target: dummyRenderTarget },
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
deferred: new Material(
|
deferred: new Material(
|
||||||
@@ -61,13 +61,13 @@ export class Rings extends Entity {
|
|||||||
ringsFrag,
|
ringsFrag,
|
||||||
{
|
{
|
||||||
defines: { 'DEFERRED': 'true' },
|
defines: { 'DEFERRED': 'true' },
|
||||||
initOptions: { geometry, target: dummyRenderTargetOneDrawBuffers },
|
initOptions: { geometry, target: dummyRenderTarget },
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
shadow: new Material(
|
shadow: new Material(
|
||||||
ringsVert,
|
ringsVert,
|
||||||
depthFrag,
|
depthFrag,
|
||||||
{ initOptions: { geometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry, target: dummyRenderTarget } },
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@ import sphereParticleRenderVert from '../shaders/sphere-particles-render.vert';
|
|||||||
import { gl, glCat } from '../globals/canvas';
|
import { gl, glCat } from '../globals/canvas';
|
||||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
const PARTICLES_SQRT = 256;
|
const PARTICLES_SQRT = 256;
|
||||||
const PARTICLES = PARTICLES_SQRT * PARTICLES_SQRT;
|
const PARTICLES = PARTICLES_SQRT * PARTICLES_SQRT;
|
||||||
@@ -24,7 +24,7 @@ export class SphereParticles extends Entity {
|
|||||||
const materialCompute = new Material(
|
const materialCompute = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
sphereParticleComputeFrag,
|
sphereParticleComputeFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
|
|
||||||
materialCompute.addUniform( 'particlesSqrt', '1f', PARTICLES_SQRT );
|
materialCompute.addUniform( 'particlesSqrt', '1f', PARTICLES_SQRT );
|
||||||
@@ -83,7 +83,7 @@ export class SphereParticles extends Entity {
|
|||||||
const shadow = new Material(
|
const shadow = new Material(
|
||||||
sphereParticleRenderVert,
|
sphereParticleRenderVert,
|
||||||
depthFrag,
|
depthFrag,
|
||||||
{ initOptions: { geometry: geometryRender, target: dummyRenderTargetFourDrawBuffers } },
|
{ initOptions: { geometry: geometryRender, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
|
|
||||||
const materialsRender = { deferred, shadow };
|
const materialsRender = { deferred, shadow };
|
||||||
|
@@ -14,7 +14,7 @@ import { Lambda } from '../heck/components/Lambda';
|
|||||||
import { auto } from '../globals/automaton';
|
import { auto } from '../globals/automaton';
|
||||||
import { sufferList } from '../sufferList';
|
import { sufferList } from '../sufferList';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
const PARTICLES = 256;
|
const PARTICLES = 256;
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ export class SufferTexts extends Entity {
|
|||||||
const materialCompute = new Material(
|
const materialCompute = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
sufferTextsComputeFrag,
|
sufferTextsComputeFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
if ( process.env.DEV ) {
|
if ( process.env.DEV ) {
|
||||||
if ( module.hot ) {
|
if ( module.hot ) {
|
||||||
|
@@ -10,7 +10,7 @@ import trailsRenderVert from '../shaders/trails-render.vert';
|
|||||||
import { gl, glCat } from '../globals/canvas';
|
import { gl, glCat } from '../globals/canvas';
|
||||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTargetOneDrawBuffers } from '../globals/dummyRenderTarget';
|
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
|
||||||
const TRAILS = 4096;
|
const TRAILS = 4096;
|
||||||
const TRAIL_LENGTH = 64;
|
const TRAIL_LENGTH = 64;
|
||||||
@@ -23,7 +23,7 @@ export class Trails extends Entity {
|
|||||||
const materialCompute = new Material(
|
const materialCompute = new Material(
|
||||||
quadVert,
|
quadVert,
|
||||||
trailsComputeFrag,
|
trailsComputeFrag,
|
||||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
|
|
||||||
materialCompute.addUniform( 'trails', '1f', TRAILS );
|
materialCompute.addUniform( 'trails', '1f', TRAILS );
|
||||||
@@ -115,7 +115,7 @@ export class Trails extends Entity {
|
|||||||
const shadow = new Material(
|
const shadow = new Material(
|
||||||
trailsRenderVert,
|
trailsRenderVert,
|
||||||
depthFrag,
|
depthFrag,
|
||||||
{ initOptions: { geometry: geometryRender, target: dummyRenderTargetOneDrawBuffers } },
|
{ initOptions: { geometry: geometryRender, target: dummyRenderTarget } },
|
||||||
);
|
);
|
||||||
|
|
||||||
const materialsRender = { deferred, shadow };
|
const materialsRender = { deferred, shadow };
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||||
|
|
||||||
export const dummyRenderTargetOneDrawBuffers = new BufferRenderTarget( {
|
export const dummyRenderTarget = new BufferRenderTarget( {
|
||||||
width: 1,
|
width: 1,
|
||||||
height: 1,
|
height: 1,
|
||||||
numBuffers: 4,
|
|
||||||
name: process.env.DEV && 'dummyRenderTargetOneDrawBuffers',
|
name: process.env.DEV && 'dummyRenderTargetOneDrawBuffers',
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user