• P
    primesoftware

    Ok, now if I wanted to work with pixels as units (i.e. for mouse clicks) is there a way to set the glViewport in Kha?

    posted in Kode read more
  • P
    primesoftware

    I'm still fairly new to the graphics field and was curious how to deal with NDCs vs pixel units in Kha. I know that say -1, 1 will be a different pixel value on different displays and thus possibly a different aspect ratio too. Lets say I wanted to make a square across all platforms (i.e. [-0.5, -0.5], [0.5, 0.5], [-0.5, 0.5], [0.5, -0.5]) in Kha, how would I make sure it doesn't get stretched on landscape views? In GL I've read you use and ortho matrix which Kha has in FastMatrix4x4, but is that it?

    posted in Kode read more
  • P
    primesoftware

    @Robert: Awesome! I'll see what I can whip up. I also found this (https://github.com/Chlumsky/msdfgen). It gives nice sharp lines in addition to being a good text renderer. I'll see if I can comprehend the algo and implement it in Haxe. The core however has no dependencies if C++11 is used. It will probably compile for emscripten if its that light. Hmm....option options.....

    posted in Kode read more
  • P
    primesoftware

    @Robert Hmm.....I did a little digging and found someone has already has C++ externs for Haxe (https://github.com/dazKind/hx-nanovg). Also, NanoVG does do an Emscripten compile to work with canvas. The bgfx engine incorporates nanovg and is HTML5 compatible.

    I'm wondering though if a pure Kha implementation would be better. At the end of the day GPU's don't really draw curves (excluding the new NV_path thing-a-majig). They draw small lines on quads and calculate the vertex position to make it look like a curve. You've already got line drawing capabilities in Kha (is it based on GL_LINES mode?) so drawing curves isn't far off. I would just have to whip out some math skills I haven't used in about 8 years or so......:-)

    posted in Kode read more
  • P
    primesoftware

    Does Kha have a vector drawing API like Nanovg? If not, do would it be of interest?

    posted in Kode read more
  • P
    primesoftware

    @Robert WOW....I'm stupid....I mixed those two up!! Everything is sailing now....thanks guys!

    posted in Kode read more
  • P
    primesoftware

    Hmm.....not sure. Ok, I think I got some of it worked out but Kode studio is telling me the simple shader is not valid....

    ERROR: 0:2: 'attribute' : not supported in this stage: fragment
    ERROR: 0:2: 'float' : type requires declaration of default precision qualifier
    ERROR: 0:6: 'gl_Position' : undeclared identifier
    ERROR: 0:6: 'assign' : cannot convert from 'temp 4-component vector of float' to 'temp float'
    ERROR: 4 compilation errors. No code generated.

    SPIRV is not generated for failed compile or link
    ERROR: 0:3: 'gl_FragColor' : undeclared identifier
    ERROR: 0:3: 'assign' : cannot convert from 'const 4-component vector of float' to 'temp float'
    ERROR: 2 compilation errors. No code generated.
    SPIRV is not generated for failed compile or link

    Assets done

    posted in Kode read more
  • P
    primesoftware

    Hi all,
    It has been awhile since I've played with Kha, but want to use it for an academic app. I'm trying to get a basic example working from lubos' tutorial. I think the API has changed since I cannot find some of the classes like Loader. I've got frag and vert shaders is Sources/Shaders and added the corresponding line to the khafile.js:

    project.addShaders('Sources/Shaders/**');

    How do I actually use the shaders that get loaded?

    Also, when I issue the following command:

    node Kha/make html5

    I get the following output...

    module.js:442
    throw err;
    ^

    Error: Cannot find module '/home/me/Programming/Game_Kha/Kha/make'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:160:18)
    at node.js:456:3

    I managed to use Kode Studio to get a window to open up.

    posted in Kode read more

Looks like your connection to Kode Forum was lost, please wait while we try to reconnect.