https://linen.dev logo
Join Discord
Powered by
# lime
  • t

    tall-teacher-57409

    05/05/2023, 7:56 AM
    ahh yeah I see, I think I now understand this sorta workflow, thank you 👍
  • t

    tall-teacher-57409

    05/05/2023, 9:51 AM
    https://gist.github.com/bwkam/5f364abff61c0ec960ed1e1ca6129bd7 I carried on with the rest of the chapter (rendering a rectangle), im sure im doing everything right here but the rectangle isn't showing
  • h

    hallowed-ocean-84954

    05/05/2023, 1:27 PM
    Ah .... yeah think I see the issue. Your indiciesData array is a Float32Array. It needs to be an Int32Array.
  • h

    hallowed-ocean-84954

    05/05/2023, 1:27 PM
    @tall-teacher-57409 ^
  • t

    tall-teacher-57409

    05/05/2023, 1:38 PM
    oh alr, I'll try it
  • t

    tall-teacher-57409

    05/05/2023, 1:41 PM
    yay I see a rectangle now, thank you
  • h

    hallowed-ocean-84954

    05/05/2023, 1:42 PM
    Nice
  • t

    tall-teacher-57409

    05/05/2023, 8:47 PM
    this section is about gradually changing the colors of the triangle through a uniform, but its just a simple stupid thing I don't get, why do we get the green value by
    (sin(timeValue) / 2.0f) + 0.5f;
    , how does that make sense? (I know what sine is but uhm im so dumb to understand why)

    https://cdn.discordapp.com/attachments/769686258049351722/1104147456469512212/image.png▾

  • b

    bulky-insurance-39338

    05/05/2023, 8:50 PM
    sin(timeValue) / 2.0) goes up and down from -0.5 to +0.5
  • b

    bulky-insurance-39338

    05/05/2023, 8:51 PM
    so the green colorchannel value from 0.0 to 1.0
  • b

    bulky-insurance-39338

    05/05/2023, 8:52 PM
    ( e.g. if the greenValue is a
    uniform
    to access its value per shader globally like )
  • b

    bulky-insurance-39338

    05/05/2023, 8:55 PM
    most (e.g. shadertoy) gives you a
    uniform
    for the Time itself, so you can calculate some "movement" or colorchanging by glsl inside shader directly ( e.g. the sin(time) to let color blinking or somewhat else )
  • t

    tall-teacher-57409

    05/05/2023, 8:57 PM
    agh thanks for the reply, but im still confused why specifically
    sin
    , why divide by two, and why add +0.5, I just want to get the math concept behind it
  • h

    hallowed-ocean-84954

    05/05/2023, 8:59 PM
    Sin oscillates about 0 between -1 and 1. So divide by 2 gives between -0.5 and 0.5. Then add 0.5. Now it's between 0 and 1.
  • b

    bulky-insurance-39338

    05/05/2023, 8:59 PM
    sin(x)
    goes from -1.0 to 1.0
  • h

    hallowed-ocean-84954

    05/05/2023, 9:00 PM
    That then complies with rgb 0-1 values.
  • b

    bulky-insurance-39338

    05/05/2023, 9:01 PM

    https://cdn.discordapp.com/attachments/769686258049351722/1104150822398472243/380px-Sine_cosine_one_period.svg.png▾

  • t

    tall-teacher-57409

    05/05/2023, 9:04 PM
    ahh I think I get it now, thanks to both of you <3
  • t

    tall-teacher-57409

    05/05/2023, 9:07 PM
    and btw, cosine will do the same thing right?
  • h

    hallowed-ocean-84954

    05/05/2023, 9:09 PM
    Yep
  • b

    bulky-insurance-39338

    05/05/2023, 9:14 PM
    have some old sample also for, so if you look into browser-console you will see the generated vertex- and fragmentshadercode for color-changing per time: http://www.maitag.de/semmi/haxelime/peote-view-remaster/anim-simple/ ()
  • b

    bright-gpu-74537

    05/05/2023, 10:28 PM
    was this drawn in lime? It looks nice, not sure ive seen that type of AA in lime / openfl
  • b

    bulky-insurance-39338

    05/05/2023, 10:31 PM
    lime + peote-view lib.
  • b

    bright-gpu-74537

    05/05/2023, 10:36 PM
    looks really sharp / smooth... 👏
  • b

    bulky-insurance-39338

    05/05/2023, 10:37 PM
    thx
  • b

    bulky-insurance-39338

    05/05/2023, 10:40 PM
    have a proto also now where you can write
    pure
    opengl-code directly inside a peote-view
    Display
    :
  • b

    bright-gpu-74537

    05/05/2023, 10:56 PM
    poete-graph soon? 🙂
  • b

    bulky-insurance-39338

    05/05/2023, 10:58 PM
    no 😅 (but can be hooked inside now) ... i am also more like to draw all into quad (glsl-
    curve
    -drawed) patches
  • b

    bright-gpu-74537

    05/05/2023, 10:59 PM
    either way, looks really nice, ive been dealing with graphs alot recently, so impressed to see a pure haxe (lime) solution that looks so clean
  • b

    bulky-insurance-39338

    05/05/2023, 11:03 PM
    next peote-view feature will be a better
    blend
    mode (between the Display/Program-Layers) .. at now there is only alpha on/off (wanna have all modes like here: )
1...105106107...138Latest