Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Material serialization hook #14259

Closed
wants to merge 2 commits into from

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.

None yet

2 participants