-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
[WIP] per channel uv transform example #14174
Conversation
v3 copies the transform matrix logic, i also moved the uniform creation to be synchronous. |
It took me awhile to step through this example, but it does show one way to use I understand this to be a feasibility study. We would not expect users to do this, obviously. |
Why not if it is encapsulated somehow? The user only sees this:
Maybe
Advanced user sees example how to make this ^ |
@pailhead |
I mustered up a quick example to override the
vUv
value in the shaders.http://dusanbosnjak.com/test/webGL/three-materials-extended/webgl_materials_extended_multiple_uvs_props.html
I used roughnessMap, specularMap, metalnessMap and map and added a simple scale + offset to each.
It's not the cleanest thing but it's an example of how to quickly prototype something without affecting the core.
#14149
#12788
#12608
#13831
#8278
#5876
It's easy to also expose these, but for some reason i think
onBeforeCompile
fired twice. I actually tried to mimickonAfterParse
becauseonBeforeCompile
is alsoonBeforeParse
.This is another example of using shader injection, specifically with the currently available
onBeforeCompile
. I think it's trivial to solve issues such as the ones linked with this kind of an api. However, i think there are better alternatives to it:#13198
I think that this is a valid use case to find itself in the core, (transforms probably don't belong on textures, rather texture slots) but since it's a complicated process to propose and review something like that,
onBeforeCompile
allows for quick prototyping.In this particular case, it mimicked a script that one could write to replace some code over many files, rather than doing it manually. For production it's a bit clunky, that's where i'd propose an alternative. Even if this weren't in the core, i think the area of GLSL is so self contained that this would be an easy effect to carry across and combine with other shader modifications.