Kaynağa Gözat

Minor ui changes

master
Palash Bansal 11 ay önce
ebeveyn
işleme
d23498dfc0
No account linked to committer's email address

+ 4
- 4
package-lock.json Dosyayı Görüntüle

@@ -15,7 +15,7 @@
"popmotion": "^11.0.5",
"stats.js": "^0.17.0",
"ts-browser-helpers": "^0.16.2",
"uiconfig.js": "^0.1.3"
"uiconfig.js": "^0.1.5"
},
"devDependencies": {
"@rollup/plugin-json": "^6.0.0",
@@ -10502,9 +10502,9 @@
"license": "MIT"
},
"node_modules/uiconfig.js": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/uiconfig.js/-/uiconfig.js-0.1.3.tgz",
"integrity": "sha512-Q3eXWGrwXO46lkjfCsMQX6fsMKLmg4u4rrvZMkRJlQiDmsQyCaDdIJy7CMKrBWWfL9e6f4w+66SHAb+u4rOL2g==",
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/uiconfig.js/-/uiconfig.js-0.1.5.tgz",
"integrity": "sha512-qsNfb0cnMTpTk9rp6i6wXHJh3w02vxoi2GceYwRfqjqtgmGeFahAuQpdN6d0qR8V0ALs54eyfDOljo50ccNXgw==",
"license": "MIT"
},
"node_modules/unbox-primitive": {

+ 2
- 2
package.json Dosyayı Görüntüle

@@ -127,7 +127,7 @@
"popmotion": "^11.0.5",
"stats.js": "^0.17.0",
"ts-browser-helpers": "^0.16.2",
"uiconfig.js": "^0.1.3"
"uiconfig.js": "^0.1.5"
},
"peerDependencies": {
"three": "https://github.com/repalash/three.js-modded/releases/download/v0.158.1004/package.tgz"
@@ -139,7 +139,7 @@
},
"//": {
"dependencies": {
"uiconfig.js": "^0.1.3",
"uiconfig.js": "^0.1.5",
"ts-browser-helpers": "^0.16.2",
"three": "https://github.com/repalash/three.js-modded/releases/download/v0.158.1004/package.tgz",
"three-f": "https://github.com/repalash/three.js-modded/archive/refs/tags/v0.158.1004.tar.gz",

+ 0
- 1
plugins/tweakpane/src/tpImageInputGenerator.ts Dosyayı Görüntüle

@@ -190,7 +190,6 @@ function proxySetValue(v: any, cc: any, config: UiObjectConfig, viewer: ThreeVie
return
}

// todo do same in blueprint editor
if (SVGTextureLoader.USE_CANVAS_TEXTURE && (v.src?.endsWith('.svg') || v.src?.startsWith('data:image/svg'))) {
// due to windows bug which cannot load svg files in webgl without a width and height
const canvas = document.createElement('canvas')

+ 2
- 0
src/plugins/export/AssetExporterPlugin.ts Dosyayı Görüntüle

@@ -88,6 +88,7 @@ export class AssetExporterPlugin extends AViewerPluginSync {
uiConfig: UiObjectConfig = {
type: 'folder',
label: 'Asset Export',
expanded: true,
children: [
{
type: 'input',
@@ -96,6 +97,7 @@ export class AssetExporterPlugin extends AViewerPluginSync {
{
type: 'folder',
label: 'GLB Export',
expanded: true,
children: [
{
type: 'checkbox',

+ 1
- 1
src/plugins/pipeline/DepthBufferPlugin.ts Dosyayı Görüntüle

@@ -47,7 +47,7 @@ export class DepthBufferPlugin

target?: DepthBufferPluginTarget

@uiImage('Depth Buffer' /* {readOnly: true}*/) texture?: Texture
@uiImage('Depth Buffer', {readOnly: true}) texture?: Texture

// @uiConfig() // not supported in this material yet
readonly material: MeshDepthMaterial = new MeshDepthMaterialOverride({

+ 4
- 4
src/plugins/pipeline/GBufferPlugin.ts Dosyayı Görüntüle

@@ -74,20 +74,20 @@ export class GBufferPlugin

target?: GBufferPluginTarget

// @uiConfig(/* {readOnly: true}*/) // todo: fix bug in uiconfig or tpImageGenerator because of which 0 index is not showing in the UI, when we uncomment this
// @uiConfig({readOnly: true}) // todo: fix bug in uiconfig or tpImageGenerator because of which 0 index is not showing in the UI, when we uncomment this
textures: Texture[] = []

@uiImage(/* {readOnly: true}*/)
@uiImage(undefined, {readOnly: true})
get normalDepthTexture(): ITexture|undefined {
return this.textures[0]
}

@uiImage(/* {readOnly: true}*/)
@uiImage(undefined, {readOnly: true})
get flagsTexture(): ITexture|undefined {
return this.textures[1]
}

@uiImage(/* {readOnly: true}*/)
@uiImage(undefined, {readOnly: true})
get depthTexture(): (ITexture&DepthTexture)|undefined {
return this.target?.depthTexture
}

+ 1
- 1
src/plugins/pipeline/NormalBufferPlugin.ts Dosyayı Görüntüle

@@ -40,7 +40,7 @@ export class NormalBufferPlugin
public static readonly PluginType = 'NormalBufferPlugin'

target?: NormalBufferPluginTarget
@uiImage('Normal Buffer' /* {readOnly: true}*/) texture?: Texture
@uiImage('Normal Buffer', {readOnly: true}) texture?: Texture
readonly material: MeshNormalMaterial = new MeshNormalMaterialOverride({
blending: NoBlending,
})

+ 2
- 2
src/plugins/pipeline/ProgressivePlugin.ts Dosyayı Görüntüle

@@ -36,7 +36,7 @@ export class ProgressivePlugin

@serialize() @uiInput('Frame count') maxFrameCount: number

// @uiImage('Last Texture' /* {readOnly: true}*/) texture?: Texture
// @uiImage('Last Texture', {readOnly: true}) texture?: Texture

get texture(): Texture | undefined {
return this.target?.texture
@@ -54,7 +54,7 @@ export class ProgressivePlugin
return this._viewer ? Array.from(this._targets.values()).map(t => t.texture) : []
}

@uiImage('Last Texture' /* {readOnly: true}*/)
@uiImage('Last Texture', {readOnly: true})
get mainTexture() {
return this._viewer ? this.getTarget(this._viewer.scene.mainCamera)?.texture : undefined
}

+ 1
- 1
src/plugins/pipeline/SSAOPlugin.ts Dosyayı Görüntüle

@@ -33,7 +33,7 @@ export class SSAOPlugin
dependencies = [GBufferPlugin]

target?: SSAOPluginTarget
@uiImage('SSAO Buffer' /* {readOnly: true}*/) texture?: Texture
@uiImage('SSAO Buffer', {readOnly: true}) texture?: Texture

@uiConfig() declare protected _pass?: SSAOPluginPass


+ 3
- 3
src/rendering/RenderManager.ts Dosyayı Görüntüle

@@ -68,7 +68,7 @@ export class RenderManager<TE extends IRenderManagerEventMap = IRenderManagerEve
}

@serialize()
@uiDropdown('Shadow Map Type', ['BasicShadowMap', 'PCFShadowMap', 'PCFSoftShadowMap', 'VSMShadowMap'].map((v, i) => ({label: v, value: i})))
@uiDropdown('Shadow Map Type', ['BasicShadowMap', 'PCFShadowMap', 'PCFSoftShadowMap', 'VSMShadowMap'].map((v, i) => ({label: v, value: i})), {tags: ['advanced']})
@bindToValue({obj: 'shadowMap', key: 'type', onChange: RenderManager.prototype._shadowMapTypeChanged})
shadowMapType: ShadowMapType

@@ -80,7 +80,7 @@ export class RenderManager<TE extends IRenderManagerEventMap = IRenderManagerEve
this.reset()
}

@uiConfig(undefined, {label: 'Passes'})
@uiConfig(undefined, {label: 'Passes', tags: ['advanced'], order: 1000})
private _passes: IPipelinePass[] = []
private _pipeline: IPassID[] = []
private _passesNeedsUpdate = true
@@ -108,7 +108,7 @@ export class RenderManager<TE extends IRenderManagerEventMap = IRenderManagerEve
@onChange2(RenderManager.prototype.rebuildPipeline)
public autoBuildPipeline = true

@uiButton('Rebuild Pipeline', {sendArgs: false})
@uiButton('Rebuild Pipeline', {sendArgs: false, tags: ['advanced']})
rebuildPipeline(setDirty = true): void {
this._passesNeedsUpdate = true
if (setDirty) this._updated({change: 'rebuild'})

+ 7
- 7
src/viewer/ThreeViewer.ts Dosyayı Görüntüle

@@ -266,7 +266,13 @@ export class ThreeViewer extends EventDispatcher<Record<IViewerEventTypes, IView
renderEnabled = true
renderStats: GLStatsJS
readonly assetManager: AssetManager
@uiConfig() @serialize('renderManager')
/**
* The Scene attached to the viewer, this cannot be changed.
* @type {RootScene}
*/
@uiConfig(undefined, {label: 'Scene', expanded: true}) @serialize('scene')
private readonly _scene: RootScene
@uiConfig(undefined, {label: 'Rendering', expanded: true}) @serialize('renderManager')
readonly renderManager: ViewerRenderManager
get materialManager() {
return this.assetManager.materials
@@ -328,12 +334,6 @@ export class ThreeViewer extends EventDispatcher<Record<IViewerEventTypes, IView
private readonly _canvas: HTMLCanvasElement
// this can be used by other plugins to add ui elements alongside the canvas
private readonly _container: HTMLElement // todo: add a way to move the canvas to a new container... and dispatch event...
/**
* The Scene attached to the viewer, this cannot be changed.
* @type {RootScene}
*/
@uiConfig() @serialize('scene')
private readonly _scene: RootScene
private _needsResize = false
private _isRenderingFrame = false
private _objectProcessor: IObjectProcessor = {

Loading…
İptal
Kaydet