-
-
Notifications
You must be signed in to change notification settings - Fork 184
Description
I'm working on switching from the proxy-based version of TSL to the prototype version (based on mrdoob/three.js#31691). The main problem I'm running into is that there are some naming collisions between the TSL methods and some properties/methods that exist on the Node sub-classes.
For example:
StackNode.add()conflicts with the TSLadd()methodRenderOutputNode.toneMappingandToneMappingNode.toneMappingconflict with the TSLtoneMapping()methodStorageBufferNode.element()andUniformArrayNode.element()conflict with the TSLelement()method- This one might be okay if the method signatures are compatible
We used to be able to handle this to some degree before because any proxied Nodes had a type of ShaderNodeObject<Node> and the ShaderNodeObject type was able to check the specificNode type and not override the method/property if it existed on that Node type. However, this was still not ideal because it meant that some ShaderNodeObject<Node> types were not assignable to others.
This is a more pressing issue now since I'm trying to add the TSL methods to the Node type directly and so the conflicts are more apparent and TypeScript produces errors since the method/properties are not compatible with each other.
One solution I was considering was making it so that some of the TSL methods are only available on some Node types, but that seems like it could get kind of messy.
@sunag @Mugen87 Do you have any thoughts on this or any ideas on how to solve this issue?