[WIP] per channel uv transform example #14174
Closed
pailhead wants to merge 4 commits intomrdoob:devfrom
Closed
Conversation
Contributor
Author
|
v3 copies the transform matrix logic, i also moved the uniform creation to be synchronous. |
This was referenced May 30, 2018
Closed
Collaborator
|
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. |
Contributor
Author
|
Why not if it is encapsulated somehow? The user only sees this: Maybe Advanced user sees example how to make this ^ |
This was referenced Jun 3, 2018
This was referenced Jun 10, 2018
Owner
|
@pailhead |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I mustered up a quick example to override the
vUvvalue 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
onBeforeCompilefired twice. I actually tried to mimickonAfterParsebecauseonBeforeCompileis 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,
onBeforeCompileallows 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.