We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi i'm trying to understand and use the shaders from processing's examples, I'd like to take the Nebula one and to put it into a program that I made. But when I copy/paste the whole code where it should be, and take the .glsl file, I have an error when I start the program : Your shader needs to be of TEXTURE type to render this geometry properly, using default shader instead.
Also I'd like to put it behind another image or text maybe, but it doesn't seem to work so far. Thanks :)
Answers
? :(
Tutorial here:
https://processing.org/tutorials/pshader/
see where toonFrag.glsl has a line in it that reads
well, there's a TEXTURE shader equivalent
so try that. you can also define this within the processing code iirc.
Code listing 5.1 has a TEXTURE example.
Sorry for long responce, where do i put the #define because i juste want to take a GLSL file and it should works as in the example (where there is just a PShader nebula)
If you don't see what i'm talking about the example is in Processing then Examples/topics/Shaders and nebula
Aren't the textures in a separate file on the hard drive that get loaded when code runs?
Textures are any pimage you want to use.
Put the #define at the top of the glsl file. There are examples in the late I linked to.
@Chrisis Yes there is only a .glsl file who's load and that's why.
@koogs Just why shoudl I do that if the example works ?
Are you talking about this nebula?
https://github.com/processing/processing-docs/blob/master/content/examples/Topics/Shaders/Nebula/Nebula.pde
If so then that is a colour shader and says as much at the top of the glsl file.
If you change the pde and add a texture then you get the error message.
Yes I'm talking about this one, but I'm not changing the pde, just adding things so it might not be different right ?
Then you are changing the pde
Yes ofc, but the original code is intact
Could the problem come from the difference between the size of the example's window and mine ?
Because I tried to add the #define without any results