shaders question?

About Monkey 2 Forums Monkey 2 Programming Help shaders question?

This topic contains 3 replies, has 3 voices, and was last updated by  nerobot 1 year, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12125

    Jesse
    Participant

    I was just looking at some of the threads about shaders and run into the thread started by @ethernaut were he post a link to a shader book and a link to some of examples converted to Monkey2. I tried to match them but they are completely different for example the the second example, the original shader illustrated:

    [/crayon]

    and the Monkey2 code looks like this:

    [/crayon]

    and this:

    [/crayon]

    it makes the two completely different. for starters the monkey 2 version does not use the time variable or the trig functions inside the shader. I tried to use it the same way as the original and it doesn’t rotate the colors. I am guessing because the variable u_time doesn’t work with monkey2. This leads me to the conclusion that Monkey2 doesn’t pass variables to shaders?

    If that is the case, does that make the shader a bit limited and/or slower?
    this also makes the tutorial book posted by @ethernaut(https://thebookofshaders.com )in most cases almost impossible to duplicate with Monkey2. it’s obviously doable but in my opinion it doesn’t illustrate the full power of the shader.
    ?????????????????????????????????

    I really don’t know what I am doing. This is just a reflection of my ignorance. 🙂

    #12126

    Ethernaut
    Participant

    Hi, Sorry if that was confusing! Maybe I should remove the reference to the book to make it less confusing.

    I wasn’t trying to translate the book’s examples one by one, I was just experimenting with how to achieve certain things using Monkey2 (transparency, passing variables to the shader, using textures, etc) and was using the book as a rough guide.

    For instance, example 2 uses Canvas.Color, which is something specific to Mojo and isn’t mentioned in the book, which is about WebGL using a javascript library. But as far as I can tell, all examples they have are completely doable in Monkey2.

    I recommend simply doing the book’s examples in their website without worrying about Monkey2, then taking a peek at the M2 code just as examples on how to solve some specific problems using Mojo.

    #12142

    Jesse
    Participant

    Thanks, I have been playing around with the code, I can get the examples as they are in the book, and I can modify the code in the GLSL editor and get different results but I am having problems converting the code to Monkey2. I will keep trying but any help would really be appreciated.

    #12144

    nerobot
    Participant

    Mark recently had moved to opengl from gles2.0.

    Now we have more possibilities.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.