Extra texture uniform to Fragment Shader #10358
Unanswered
DominikKoller
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I'm new to Pixi.
I'm trying to pass a texture to a Fragment shader, and I keep failing.
I want just a texture effect, so I copied the example from here:
https://pixijs.com/8.x/examples/filters-advanced/custom
My first question here is:
Why can this not be written as
?
Now I am trying to pass an extra texture to the fragment shader, like so:
I have tried
uniforms: { uExtraTexture: extraTexture, },
or adding
uniforms: { uExtraTexture: { value: extraTexture, type: 'sampler2D' }, },
But none of this seems to work. All the examples I can find use a different syntax, without the GlProgram constructor, like here:
https://stackoverflow.com/questions/64072964/passing-textures-to-fragment-shader-in-pixi-js
But changing to this syntax seems to break the custom shader example I am basing my code on:
https://pixijs.com/8.x/examples/filters-advanced/custom
This is currently my fragment shader (note I am not using uTexture at all, this is just to simplify, in the end I will need both):
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions