Palash Bansal 2 лет назад
Родитель
Сommit
765838d729
Аккаунт пользователя с таким Email не найден

+ 1
- 1
src/core/object/RootScene.ts Просмотреть файл

@@ -449,7 +449,7 @@ export class RootScene extends Scene<ISceneEvent, ISceneEventTypes> implements I

updateShaderProperties(material: {defines: Record<string, string|number|undefined>, uniforms: {[name: string]: IUniform}}): this {
if (material.uniforms.sceneBoundingRadius) material.uniforms.sceneBoundingRadius.value = this._sceneBoundingRadius
else console.warn('BaseRenderer: no uniform: frameCount')
else console.warn('BaseRenderer: no uniform: sceneBoundingRadius')
return this
}


+ 1
- 1
src/materials/index.ts Просмотреть файл

@@ -1,2 +1,2 @@
export {MaterialExtender, updateMaterialDefines} from './MaterialExtender'
export {MaterialExtender, updateMaterialDefines, uiConfigMaterialExtension} from './MaterialExtender'
export type {MaterialExtension, IShaderPropertiesUpdater} from './MaterialExtension'

+ 1
- 1
src/plugins/ui/RenderTargetPreviewPlugin.ts Просмотреть файл

@@ -9,7 +9,7 @@ import {ITexture} from '../../core'
import {ExtendedCopyPass} from '../../postprocessing'

export interface RenderTargetBlock {
target: ValOrFunc<IRenderTarget|{texture?: ValOrArr<ITexture>}|undefined>
target: ValOrFunc<IRenderTarget|{texture?: ValOrArr<ITexture>}|undefined|null>
name: string
visible: boolean
transparent: boolean

+ 1
- 1
src/postprocessing/sortPasses.ts Просмотреть файл

@@ -52,7 +52,7 @@ export function sortPasses(ps: IPipelinePass<IPassID>[]) {
if (Object.keys(dict).length < 1) break
if (!updated) {
console.error(entries, dict, pipeline)
throw 'Not possible 2'
throw 'Not possible 2' // when some dependency(required) doesnt exist. todo: show better error.
break
}
}

+ 1
- 1
src/rendering/RenderManager.ts Просмотреть файл

@@ -280,7 +280,7 @@ export class RenderManager<TEvent extends BaseEvent = IRenderManagerEvent, TEven
}

updateShaderProperties(material: {defines: Record<string, string|number|undefined>, uniforms: {[name: string]: IUniform}}): this {
// if (material.uniforms.currentFrameCount) material.uniforms.currentFrameCount.value = this.frameCount
if (material.uniforms.currentFrameCount) material.uniforms.currentFrameCount.value = this.frameCount
if (!this.stableNoise) {
if (material.uniforms.frameCount) material.uniforms.frameCount.value = this._totalFrameCount
else console.warn('RenderManager: no uniform: frameCount')

+ 5
- 2
src/three/utils/decorators.ts Просмотреть файл

@@ -6,7 +6,7 @@ import {AnyFunction, getOrCall, safeSetProperty, ValOrFunc} from 'ts-browser-hel
* @param propKey - uniform name
* @param thisTarget - if `this` is the uniform (because uniforms = this wont work). It also adds _ in front of the name
*/
export function uniform({uniforms, propKey, thisTarget = false}: {uniforms?: any, propKey?: string|symbol, thisTarget?:boolean} = {}): PropertyDecorator {
export function uniform({uniforms, propKey, thisTarget = false, onChange}: {uniforms?: any, propKey?: string|symbol, thisTarget?:boolean, onChange?: (...args: any[]) => any} = {}): PropertyDecorator {
// backing up properties as values are different when called again, no idea why.
const cUniforms = !!uniforms
const cPropKey = !!propKey
@@ -29,8 +29,11 @@ export function uniform({uniforms, propKey, thisTarget = false}: {uniforms?: any
return getUniform(this).value
},
set(newVal: any) {
getUniform(this).value = newVal
let val = getUniform(this).value
if (val === newVal) return
val = newVal
safeSetProperty(this, 'uniformsNeedUpdate', true, true)
onChange && callOnChange.call(this, onChange, [propertyKey, newVal])
},
// configurable: true,
// enumerable: true,

Загрузка…
Отмена
Сохранить