Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Codea 1.5 (Beta 9 and 10)

2»

Comments

  • Jmv38Jmv38 Mod
    edited January 2013 Posts: 3,297

    I've hit http://glslstudio.com by random walk: have one of you guys tested it? For 7€ it seems to be the perfect companion for Codea shader edition. If no one has a feedback, i'll try it.
    (later) Well, i couldn't wait i tried it. It seems to work fine, and the shaders code can be extracted via mail. There are 3 files sent: the fragment shader .fs, the vertex shader .vs and a huge .h file containing the object definition tables. What is missing is a doc about shaders. In principle it should be codea compatible (have not tried yet) because it is made for ipad.

  • SimeonSimeon Admin Mod
    Posts: 5,417

    Very cool. Our Shader Lab will be a bit like that (the next build will have more Shader Lab features that make it a lot more useful). But that definitely looks like a useful app.

  • edited January 2013 Posts: 505

    To recreate the editor bug. Create a new blank tab with this content using portrait mode.

                        local nextChar = string.sub(gsNoteBeingPlayed,j+nextCharIndex,j+nextCharIndex)
    

    then go to the end of the line and press backspace. Then things in the middle of the line are removed.

    My old simple app Paragraf was the first app for writing shader on ios. But it's not so full of features, and mostly 2d effects. The new Codea will replace the need for it. Just missing an iPhone version of it for coding emergencies. :)

  • SimeonSimeon Admin Mod
    Posts: 5,417

    Excellent @tnlogy — that helps so much in tracking down this bug!

  • SimeonSimeon Admin Mod
    Posts: 5,417

    It turned out to be very tricky to fix. The problem was the condensed use of plus symbols going over a new line. That is, no spaces between the plus symbols and the surrounding characters. Other symbols don't have this issue.

  • edited January 2013 Posts: 489

    It may not make 1.5 given the other priorities, but in case there is capacity: more on the in-app reference in beta 1.5(10):

    backingMode

    This appears twice: a longer version as 'backingMode ( MODE) ' in the 'Display' chapter, and a shorter version as 'backingMode( mode )' in the 'Graphics' chapter. 'Related' cross-references elsewhere refer to one or other of the versions.

    Lua chapter

    This does not include all parts of the Lua standard libraries that are outside of the sandbox, for example 'debug'. If the scope of the sandbox is now limited, it may be more efficient to document what the sandbox still excludes from Codea.

    pointSize(diameter) and point(x, y)

    These functions are still part of the API, but undocumented and excluded from the autocomplete. The Editor's syntax highlighting recognises point, but not pointSize. (I cannot recall if the functions are formally deprecated.)

    pushStyle

    This does not list that it also preserves font(), fontSize(), pointSize(), textAlign(), textMode() and textWrapWidth().

    RETURN global variable

    Unlike BACKSPACE, this is undocumented.

    (Update)

    zLevel

    This has a 'transform' as a related link. The link does not work and may have been intended to link to 'translate'.

  • Posts: 489

    Further on Editor misbehaviour: the problem in beta 1.5(8) when the Editor switches from deleting single characters to deleting chunks still exists in beta 1.5(10).

  • Posts: 196

    @Simeon - Hi, I'm not sure if this was mentioned, but setContext is pretty glitched atm.
    Issue tracker doesn't offer 1.5 feedback, so i'll unload it here.

    Using setContext to render a mesh to a texture unfortunately completely messes up the z ordering.
    Here is an example:

    Screen = class()
    function Screen:init()
        self.image = image(WIDTH, HEIGHT)
        self.surface = mesh()
        self.surface:addRect(WIDTH/2, HEIGHT/2, WIDTH, HEIGHT)
        self.surface.texture = self.image
        self.surface.shader = shader("Documents:postProcess")
    end
     
    function setup()
        screen = Screen()
        mdl = loadModel("Dropbox:creature2")
        ang = 0
    end
     
    function draw()
        background(255)
     
        local x = math.sin(ang)
        local y = math.cos(ang)
        perspective(45)
        camera(x, y, 0, 0, 0, 0, 0, 1)
     
        setContext(screen.image)
            background(0, 0, 0, 0)
            mdl:draw()
        setContext()
     
        ortho()
        viewMatrix(matrix())
     
        screen.surface:draw()
     
        ang = ang + math.pi/180
    end

    Also, setContext can mess up video recording.
    Say we have the following in our setup function and we draw meshes in our draw function:

    a = image(10,10)
    b = image(10,10)
     
    setContext(a)
    setContext()

    Using setContext on "a", the video recording works fine.

    a = image(10,10)
    b = image(10,10)
     
    setContext(a)
    setContext()
     
    setContext(b)
    setContext()

    Using setContext on "a" then on "b", the video recording is messed up.

    a = image(10,10)
    b = image(10,10)
     
    setContext(a)
    setContext()
     
    setContext(a)
    setContext()

    Using setContext on "a" then on "a" again, the video recording is fine.

    Also, the += shortcut button gives "variable = variable +" in glsl too, instead of just "variable +="

    Finally, would the ability to save our shaders in dropbox be in conflict with Apple restrictions ?

    Cheers,
    Xavier

  • Jmv38Jmv38 Mod
    Posts: 3,297

    BUG SetContext i think (could be my code, but if so didnt find the error) that there is a bug with large images (WIDTHxHEIGHT) when filled with set context. Then when i display then with sprite() there is always a small offset ~100 in x and 30 in y, not always the same, and i cannot remove it with resetMatrix() resetStyle(). I tried to make a small program to show you but then the bug does not show up.

  • SimeonSimeon Admin Mod
    Posts: 5,417

    .@mpilgrem thank you for all the documentation bugs. I've fixed backingMode, pushStyle and zLevel.

    point and pointSize — I've never liked these functions and always intended to deprecate them.

    On the Lua chapter — debug should probably be documented. io.* won't be documented as it's unsandboxed by request and a temporary solution, until I can implement a different file access API that is more in line with Codea (i.e. visual pickers and in-editor editing/preview).

    I'm wondering wether RETURN should be deprecated. Testing against "\n" is probably more sensible. What are your thoughts on this?

    .@Xavier setContext doesn't allocate a z-buffer. I'll try allocating a z-buffer for setContext in the next build and see how much it affects performance.

    Thank you for posting the video recording bug.

  • Jmv38Jmv38 Mod
    edited January 2013 Posts: 3,297

    .@Simeon Could you consider solving the 'displayed position is lost when switching from one tab to the other' problem? This is really annoying when working with various classes, and making step by step improvements, like in my 'ant' program. I am surprised to be the only one complaining about that? I loose up to 5% of my time just sliding back again and again to the correct position...

  • SimeonSimeon Admin Mod
    Posts: 5,417

    .@Jmv38 Ah it seems to be an iOS 5.x issue. I was wondering why I wasn't seeing it. I'll try to figure out why it's not working in iOS 5.

  • Posts: 505

    I have been thinking about the new Codea version. Myself, I would prefer if the shaders used in my program were in a tab, just as any other code. Sure, you can reuse shaders, but it is fewer steps to edit the shaders. On the other hand I can load te shaders as strings if I want to.

    Also it would be nice if the image data used would be contained in the project so it is easy to share, just copy the project folder and put it on github. No you have to copy shaders, code and sprite data. Well just my thought about the layout. :)

  • Posts: 489

    On deprecation, is that a two stage process: (1) deprecation and (2) eventually, complete removal from the API?

    http.get() was deprecated very quickly after its first introduction. Perhaps it is now a candidate for removal in version 1.5?

    If pointSize() and point() were never really 'in' Codea, perhaps you could go straight to removal? (Their uncertain status has been flagged in past comments on the Forum for some time.)

    If RETURN has effectively been deprecated for some time (by not being documented), perhaps it too could just be removed from version 1.5. I do not think it adds anything of use to the API. As long as its removal is clearly announced, anybody who has actually used it (if anybody has) can easily add RETURN = "\n" to their code.

Sign In or Register to comment.