Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

IR-2726 Material Component Breakup #10406

Merged
merged 83 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
cb61521
remove materialByName map and stop forcing unique names
AidanCaruso May 21, 2024
892c8a6
react to mesh components to create material instances
AidanCaruso May 22, 2024
ea09c35
Merge branch 'dev' into universal-material-entities
AidanCaruso May 22, 2024
a33296f
begin converting plugins to components
AidanCaruso May 23, 2024
356ce93
wip
AidanCaruso May 23, 2024
c00ef5d
wip
AidanCaruso May 23, 2024
c67bf13
Merge branch 'dev' into universal-material-entities
AidanCaruso May 23, 2024
8055d5e
shader uniforms set by component directly
AidanCaruso May 23, 2024
b3a975d
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 4, 2024
45d1731
transparency dithering simplification wip
AidanCaruso Jun 5, 2024
6854020
fixes
AidanCaruso Jun 5, 2024
5763d5a
plugin ui and component lookup when importing from ee material extension
AidanCaruso Jun 5, 2024
7b25b88
parameters work with ecs plugin components
AidanCaruso Jun 6, 2024
8a3a508
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 6, 2024
4ca7e4d
noise offset plugin conversion
AidanCaruso Jun 7, 2024
3cce4f4
Merge branch 'universal-material-entities' of https://github.com/ethe…
AidanCaruso Jun 7, 2024
127a674
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 7, 2024
8800d81
bpcem
AidanCaruso Jun 8, 2024
fd88130
various fixes
AidanCaruso Jun 8, 2024
85fde2a
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 10, 2024
30d8384
no more plugin component
AidanCaruso Jun 10, 2024
43d4229
plugin uniforms
AidanCaruso Jun 11, 2024
fe40ab1
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 11, 2024
eddaf0e
plugin import/exports work again
AidanCaruso Jun 11, 2024
751260f
wip
AidanCaruso Jun 11, 2024
f3fd68c
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 11, 2024
11c5b27
add lambert preprocessor directives to stop threejs redefinitions
AidanCaruso Jun 11, 2024
4e19d09
undo checkshadererrors commit
AidanCaruso Jun 11, 2024
4fa5377
ditto
AidanCaruso Jun 11, 2024
1cec028
update components
AidanCaruso Jun 11, 2024
b70091a
update noise plugin
AidanCaruso Jun 11, 2024
0c1b7f9
obc api tweaks
AidanCaruso Jun 12, 2024
28fcf54
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 12, 2024
5706866
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 12, 2024
6f1f47a
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 12, 2024
31608f2
fix plugin ui
AidanCaruso Jun 13, 2024
135489e
Merge branch 'universal-material-entities' of https://github.com/ethe…
AidanCaruso Jun 13, 2024
cb94576
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 13, 2024
4703007
cleanup
AidanCaruso Jun 13, 2024
a26e499
cleanup
AidanCaruso Jun 13, 2024
cd72b5f
Merge branch 'universal-material-entities' of https://github.com/ethe…
AidanCaruso Jun 13, 2024
a8025f1
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 13, 2024
4ba3682
wip
AidanCaruso Jun 13, 2024
72626d3
remove plugin by name map
AidanCaruso Jun 13, 2024
e8cefe3
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 14, 2024
849fb61
wip
AidanCaruso Jun 14, 2024
305e5d5
Merge branch 'universal-material-entities' into material-component-br…
AidanCaruso Jun 14, 2024
955c9d3
add needsupdate to setPlugin
dinomut1 Jun 14, 2024
543a4eb
wip
AidanCaruso Jun 14, 2024
7be4d13
fix cross imports
AidanCaruso Jun 15, 2024
276ce48
fix hasplugin
AidanCaruso Jun 15, 2024
453a0e8
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 15, 2024
ba4f6a2
Merge branch 'universal-material-entities' into material-component-br…
AidanCaruso Jun 16, 2024
ad5cc16
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 17, 2024
a5ceb80
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 17, 2024
1f919ab
wip
AidanCaruso Jun 17, 2024
b513cd1
fix plugin reference issues
AidanCaruso Jun 18, 2024
db0e4a9
cleanup logs
AidanCaruso Jun 18, 2024
f72fcd8
Merge branch 'universal-material-entities' of https://github.com/ethe…
AidanCaruso Jun 18, 2024
d65af8e
fix hashing
AidanCaruso Jun 18, 2024
6b42b6d
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 18, 2024
0c4a443
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 18, 2024
c217be2
reactive material preview updates
AidanCaruso Jun 18, 2024
75bdb1f
Merge branch 'universal-material-entities' of https://github.com/ethe…
AidanCaruso Jun 18, 2024
f7b1c90
Merge branch 'universal-material-entities' into material-component-br…
AidanCaruso Jun 18, 2024
2c43dfe
fix imports
AidanCaruso Jun 18, 2024
36d5a7c
fix various regressions around plugin parameter setting and exporting
AidanCaruso Jun 18, 2024
c0be1e2
use mesh instead
AidanCaruso Jun 18, 2024
4eafa4c
Merge branch 'universal-material-entities' into material-component-br…
AidanCaruso Jun 18, 2024
edab814
Merge branch 'dev' into universal-material-entities
AidanCaruso Jun 18, 2024
056c84c
Merge branch 'universal-material-entities' into material-component-br…
AidanCaruso Jun 18, 2024
e7d4554
fix missing source component errors
AidanCaruso Jun 18, 2024
bca5813
Merge branch 'universal-material-entities' into material-component-br…
AidanCaruso Jun 18, 2024
7b853e0
Merge branch 'dev' into material-component-breakup
AidanCaruso Jun 21, 2024
ee79c2a
remove plugin entity references in material editor
AidanCaruso Jun 21, 2024
fda6389
Merge branch 'dev' into material-component-breakup
AidanCaruso Jun 21, 2024
97b8c1b
fix prototype switching
AidanCaruso Jun 21, 2024
c47ce73
Merge branch 'material-component-breakup' of https://github.com/ether…
AidanCaruso Jun 21, 2024
39add23
move materialByHash to component definition
AidanCaruso Jun 22, 2024
f7a0499
restore onremove functionality
AidanCaruso Jun 22, 2024
8aab873
Merge branch 'dev' into material-component-breakup
AidanCaruso Jun 22, 2024
dcffd40
Merge branch 'dev' into material-component-breakup
AidanCaruso Jun 24, 2024
437d977
Merge branch 'dev' into material-component-breakup
HexaField Jun 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix various regressions around plugin parameter setting and exporting
  • Loading branch information
AidanCaruso committed Jun 18, 2024
commit 36d5a7c2576f9498fc5558dccca94408d9ed4cf6
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,14 @@ export default class EEMaterialExporterExtension extends ExporterExtension {
const materialComponent = getComponent(materialEntity, MaterialComponent[MaterialComponents.State])
const prototype = getComponent(materialComponent.prototypeEntity!, MaterialComponent[MaterialComponents.Prototype])
const plugins = Object.keys(MaterialPlugins).map((plugin) => {
if (hasComponent(materialEntity, MaterialPlugins[plugin]))
return { id: plugin ?? '', uniforms: getComponent(materialEntity, MaterialPlugins[plugin]) }
if (!hasComponent(materialEntity, MaterialPlugins[plugin])) return
const pluginComponent = getComponent(materialEntity, MaterialPlugins[plugin])
const uniforms = {}
for (const key in pluginComponent) {
console.log(pluginComponent[key])
uniforms[key] = pluginComponent[key].value
}
return { id: plugin, uniforms }
})
materialDef.extensions = materialDef.extensions ?? {}
materialDef.extensions[this.name] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ export class EEMaterialImporterExtension extends ImporterExtension implements GL
if (extension.plugins) {
if (!materialDef.extras) materialDef.extras = {}
materialDef.extras['plugins'] = extension.plugins
for (const plugin of extension.plugins) {
if (!plugin?.uniforms) continue
for (const v of Object.values(plugin.uniforms)) {
if (v.type === 'texture') {
parser.assignTexture(materialParams, v.name, v.contents)
}
}
}
}
const materialComponent = getComponent(
UUIDComponent.getEntityByUUID(extension.uuid),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ export const createMaterialEntity = (material: Material, path?: string, user?: E
material.userData.plugins.map((plugin: MaterialExtensionPluginType) => {
if (!plugin) return
setComponent(materialEntity, MaterialPlugins[plugin.id])
const pluginComponent = getMutableComponent(materialEntity, MaterialPlugins[plugin.id])
const pluginComponent = getComponent(materialEntity, MaterialPlugins[plugin.id])
for (const [k, v] of Object.entries(plugin.uniforms)) {
if (v) pluginComponent[k].set(v)
if (v) pluginComponent[k].value = v
}
})
setMaterialName(materialEntity, material.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const NoiseOffsetPlugin = defineComponent({
shader.uniforms.textureSize = plugin.textureSize
shader.uniforms.frequency = plugin.frequency
shader.uniforms.amplitude = plugin.amplitude
plugin.noiseTexture.value = generateNoiseTexture(64)
shader.uniforms.noiseTexture = plugin.noiseTexture
shader.uniforms.offsetAxis = plugin.offsetAxis
shader.uniforms.time = plugin.time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export function MaterialEditor(props: { materialUUID: EntityUUID }) {
values={pluginValues.value}
onChange={(key) => async (value) => {
const property = await shouldLoadTexture(value, key, pluginParameters)
setComponent(entity, MaterialPlugins[selectedPlugin.value], { key: property })
getComponent(entity, MaterialPlugins[selectedPlugin.value])[key].value = property
pluginValues[key].set(property)
}}
defaults={pluginParameters.value}
Expand Down
Loading