Skip to content

Conversation

@pailhead
Copy link
Contributor

@pailhead pailhead commented Jun 9, 2018

Related to onBeforeCompile and serialization.

I find it odd that Material super class is aware of all the properties of all the sub classed materials:

https://github.com/mrdoob/three.js/blob/dev/src/materials/Material.js#L165-L166

Serialization has been cited as a problem with shader injections. However, with this i was able to write my own properties with the myExtendedMaterial.toJSON() as well as store references to textures.

#14231

What are generally the pain points of serializing this stuff? userData is also serialized and could be overloaded with anything, but it would make more sense to control what's included from the level of the owner of the properties.

@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2018

#14245 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants