Howdy, Stranger!

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

Codea 2.0 Beta

2456717

Comments

  • Posts: 2,161

    Thanks for:

    • The updated math library works with the code that had previously broken.
    • Renaming my sprite pack to an assetpack worked also.

    Next on the list:

    This isn't really to do with this update, rather has been around for a while. I find that the video recorded by Codea is a bit "choppy" - not nearly as smooth as when the app is running. That is to say, all looks fine in the app, even when it is recording, but the video itself is a bit jerky.

  • Posts: 505

    Works fine. My camera for Infinite 3D heightmap in a thread below, is more shaky, might my rotated vectors getting unaligned faster due to the better precision maybe, or have I had to much coffee?

    If you are working with the shader code could you please add a print when the compiler fails, would be appreciated :)

  • toffertoffer Mod
    edited January 2014 Posts: 151

    Sorry for this one, I don't know what's wrong with this chunk: https://www.dropbox.com/s/73fbmn81hyzsdg7/services.lua, but it crash Codea (2.0(5) IPad 2) when:

    • I tap on the tab name to display it
    • I paste it into a new tab

    [edit] a start, varargs crash the app

    function fn(...)
    
    end
    
  • Posts: 2,161

    Sometimes when I tap to select a line, then move the end of the selection, it selects everything from the beginning.

    Some issues with setContext: it seems to reset the matrices (or some of them), I don't think it used to.

    Please, please, please can we have z-buffering in setContext.

    With regard to the pop-ups, how about they pop-up if I drag upwards on them?

  • SimeonSimeon Admin Mod
    Posts: 5,417

    Sorry about the crash @toffer — I will have it fixed next build. It's great that you're finding these.

    @tnlogy I'll look at adding a print on compiler fails, or something similar.

    @Andrew_Stacey I have looked at z-buffering setContext, our initial attempts did not work. I'll have to have another go at it.

    Regarding the matrix reset, we haven't touched anything explicitly in setContext, but it might be due to other code changes. I'll look.

    Popups appearing instantly on drag sounds like I good idea, I'll try it out.

  • SimeonSimeon Admin Mod
    Posts: 5,417

    I'd like to get some feedback on a feature I'm considering adding.

    Inline shaders

    When you make a shader call in Codea, such as shader("Documents:MyShader") your code becomes less shareable.

    I was thinking (in particular for the "Copy" option on projects) to automatically in-line any shaders that are not built in. So your code gets re-written with:

    shader([[pasted vertex shader]], [[pasted fragment shader]])

    Would this be helpful?

  • Posts: 2,820

    @Simeon - I was thinking about writing a quick Lua script that would do that for me yesterday. Yes, that would be super useful since I tend to forget to include the shader in the code.
    I'm also wondering: are there any plans for project based assets (not global) and project folders in v2.0, or will that have to wait?
    Thanks!

  • SimeonSimeon Admin Mod
    Posts: 5,417

    @Zoyt yes there are plans for them, as to whether they will be in version 2.0: that depends on whether you want version 2.0 to come out later or sooner. Either way you'll have to wait :)

  • IgnatzIgnatz Mod
    edited January 2014 Posts: 5,396

    @Simeon - re inline shaders. I can think of two problems with inlining any shader references. One is that this will create a big mess right in the middle of the code, and secondly, they are often used multiple times, making an even bigger mess.

    Better might be to add them at the end, checking first of course that they weren't already in the code elsewhere.

    But I don't think this is necessary. Even better (and probably much easier for you) would be to provide an option within the Shader Lab to copy the code to the current project, in table form. I prefer this because then the developer sees what goes into his code, and it doesn't happen "behind his back" when he copies it to export it.

  • Posts: 2,820

    Just an idea, following up on @Ignatz's opinion (which is very good), you might try simply creating an extra project tab (when copying) that hold all the shaders that are used, so each shader is in the code once.

  • SimeonSimeon Admin Mod
    edited January 2014 Posts: 5,417

    @Ignatz very good point about multiple instances.

    The idea was to keep the code neat (with simple easy-to-read shader references) for the developer, and then in the exported version automatically integrate it just for export — not changing the project inside Codea in any way.

    I do like the idea of copying the code from the Shader Lab, or even directly from the shader picker (a "copy" button next to each shader that copies the shader as a shader(...) function call).

    But I don't like the idea of having to do this manually if you want to use asset references. As @Zoyt mentioned, project based assets might be a different path towards resolving this.

    Perhaps we could offer the option on copy? We could add a table to the end of the code with all shaders in it and then change shader asset references to reference the table, but only if the option is selected.

    Edit: @Zoyt yes, a separate tab with a two tables named something relatively unique like _codeaVShaderExport = {...} / _codeaFShaderExport = {...} could work.

  • Posts: 2,161

    Here's what I do when exporting shaders.

    --The name of the project must match your Codea project name if dependencies are used. 
    --Project: Place Project Name Here
    --Author:
    --Version: Alpha 1.0
    --Comments:
    --Options: NoConnect
    
    if localise then localise("CopyShader") end
    
    function setup()
        addShader("Gradient Fill", "GradientFill")
    end
    
    function addShader(name,tab)
        local s = shader("Documents:" .. name)
        local str = "\n\nfunction shader" .. 
                    name .. 
                    " ()\nreturn shader([[\n" .. 
                    s.vertexProgram .. 
                    "]],[[\n" .. 
                    s.fragmentProgram .. 
                    "]])\nend"
        local code = readProjectTab(tab)
        saveProjectTab(tab,code .. str)
        print("Saved shader " .. name .. " to tab " .. tab)
    end
    

    (It should remove blanks from the shader name, though)

    While we're talking about shaders, if a shader can have a texture but one isn't passed, it should use a pure white texture by default. It seems to use the last image the GPU loaded.

  • SimeonSimeon Admin Mod
    Posts: 5,417

    @Andrew_Stacey good example, I'd like to do something like that.

    Debug textures are a good idea also, a checkerboard or bright green, or even a "missing image" texture might be more useful?

  • Posts: 2,161

    I'm thinking of shaders that can be used with or without a texture and just work either way. Take my Gradient Fill texture (thread in steven8tr's colour chooser). That makes sense with and without a texture but I basically have to have two shaders for the two situations.

  • BriarfoxBriarfox Mod
    edited January 2014 Posts: 1,542

    Bug

    • When trying to import an image from photo library into documents, the save as text field is hidden at the top of the viewer. You can select it but you can not read what you type.
  • SimeonSimeon Admin Mod
    Posts: 5,417

    Thanks @Briarfox

    @Andrew_Stacey that's a good case for a plain white default

  • BriarfoxBriarfox Mod
    Posts: 1,542

    Bug

    • No error popup when a table is incorrectly declared. Codea will not launch the project. Example: test = {{1,1}{2,2}} (note missing the comma)
  • IgnatzIgnatz Mod
    Posts: 5,396

    @Simeon

    +1 for Andrew's suggestion of a default white texture for shaders.

  • Posts: 2,161

    The red flags don't seem to be working when I run some code. That is, I have a project that when I click "run" doesn't run. But there are no helpful red highlights anywhere (none of the tabs is red, and I can't find any red highlighting in any of them).

  • SimeonSimeon Admin Mod
    edited January 2014 Posts: 5,417

    @Andrew_Stacey yes, buffer errors had to be taken out for a while — they are coming back. At the moment only errors detected while you type are shown, which does not encompass all possible pre-runtime errors. Other errors might still appear when you hit play (e.g., the table example from @Briarfox).

  • Posts: 2,161

    @Simeon With regard to indentation, I've tracked it down. It isn't anonymous functions, it's the word "function" appearing inside a long comment.

    --[[
    function
    --]]
    

    throws off the indenter.

  • SimeonSimeon Admin Mod
    Posts: 5,417

    Ah thanks @Andrew_Stacey, I'll be able to fix that.

  • BriarfoxBriarfox Mod
    Posts: 1,542

    @Simeon If you long press on -- and try to select, nothing happends.

  • SimeonSimeon Admin Mod
    Posts: 5,417

    @Briarfox thanks, I'll look into it. If you are trying to uncomment something remember that you can just press the comment button (it will toggle whole-line comment off if it exists).

  • BriarfoxBriarfox Mod
    Posts: 1,542

    @Simeon Yeah I get the comment thing, but I was trying to select code, cut and paste. Not a huge hassle but you cant select --. You need to select past it then drag over.

  • toffertoffer Mod
    Posts: 151

    Maybe already tracked. When switching between tabs, the scrolling point is lost or 'arbitrary' defined, sometimes cursor is visible near the bottom, sometimes hidden because the tab is scrolled to far from top. And I wonder if it's possible to keep the scrolling/cursor point and keyboard opening state when return back from the viewer ? Hope that make sens.

  • SimeonSimeon Admin Mod
    Posts: 5,417

    @toffer switching between tabs should maintain the cursor position, I'll look into it. I thought I fixed this a few builds ago.

  • toffertoffer Mod
    edited January 2014 Posts: 151

    nvm, it's simply the tab bar that hide the 'current line', that's just arbitrary scroll up or down to find the cursor. ie: cursor is near bottom, I scroll up to grap tabs (so the cursor is hidden at bottom), swith to another tab, come back to the first one, and the cursor is hidden by tabs at the top. Anyway, that don't really matter. May I suggest, what about 2/3 fingers swipe or tap twice left/right to switch prev/next tab (I find annoying to have to scroll to catch tabs) ?

  • SimeonSimeon Admin Mod
    Posts: 5,417

    Good suggestion on the gestures. I'll try to fix the tab bar hiding the cursor.

  • Posts: 2,161

    The parameter.watch display is messed up again. There doesn't seem to be the right amount of space for the display (it seems to be clipped to a small rectangle) and there's sometimes a table <address> shown as well as the result of the watch.

  • SimeonSimeon Admin Mod
    Posts: 5,417

    @Andrew_Stacey yes, I have noticed that one, another iOS 7 thing on the list to be fixed.

  • Posts: 505

    here is a case when the parser doesnt add an end.

    foo(function ()
    end):chain(function()
        )
    

    but more urgent would be to fix color dialog when it is a function argument :)

    m:setColors(color())
    
  • Posts: 505

    Regarding shader code I think most people now write it as a string in the normal editor, so maybe it would be better to add syntax support in that view instead. A bit tricky how though, but it works for javascript in html-pages for example.

    Would be nice if you could export a project as text including encoded images, but might be a bit tricky.

    The +*- button works great now. But using () slows down the coding quite a bit, then the current solution is better I think.

  • SimeonSimeon Admin Mod
    Posts: 5,417

    @tnlogy do you mean the color() popup is inaccessible when used as a function argument?

    Can you elaborate on what you mean by using () slowing down coding?

    The complex nested function example will likely not be solved — the auto scope completion is tailored for the common case, it relies on some assumptions to ensure that it doesn't get in the way of normal coding.

  • Posts: 505

    yes, when color is an argument you have to wrap lines to make it work.

    it's the delay when pressing () to access the other buttons I mean, if the popup would show up immediately like the +-*button it would be better.

    ok, that's reasonable, just a bit inconsistent. but on the whole the update feels fresh and nice. like the color preview. would be nice with an image preview, and a ui for choosing texture for mesh, which is a bit inconvenient. Just a method returning the string itself but with a ui for it. loadTexture("Document:image").

  • SimeonSimeon Admin Mod
    Posts: 5,417

    Does anyone know of any function calls / bad arguments / things you can do in Lua that make Codea crash? I'd like to spend some time fixing some of these up (so that they instead report runtime errors, etc). Please let me know if you know of any.

  • toffertoffer Mod
    Posts: 151

    Auto complete close statement/function is fired if there an 'closing' error under. Mmhh, I don't know if it's clear... From the following, put the cursor after fn() or then and hit return.

    function fn()
    end
    if t == 0 then
        print()
    end
    function
    

    btw, I like the new in app doc design, lovely icons and nice background effect.

  • SimeonSimeon Admin Mod
    Posts: 5,417

    @toffer thank you for your feedback on the new docs design. Glad you like it.

    I think I have fixed your auto-complete scope issue for the next build. Note that in some cases it is ambiguous whether an "end" needs to be added. But in your case it is pretty clear.

  • Posts: 505

    Also like the new docs design, looking nice! Is it supposed to focus the item you came from when you go up a level though?

    Regarding design I think it would look a bit more clearer if the play button looked the same as when the keyboard is focused. Currently it doesn't give so much feedback that you've pressed it.

    If I would add a feature to the UI, I would add folders for the projects view similar to how icons on the iPad are handled. :)

  • Posts: 2,161

    I'm getting quite a few crashes when running code at the moment (generally on the second run of a project). I'm not sure if it's due to the project I'm working on or the new Codea. Are the crash reports enough information to debug this or do you need more information from me?

  • SimeonSimeon Admin Mod
    Posts: 5,417

    @tnlogy features like folders will come, but it would probably delay 2.0 too much to add them now. I'm working on getting the bugs fixed and finishing the visual re-design.

    Do you mean looking up from the editor shows the path from which you came? (E.g., Graphics -> sprite() -> details). That is intentional.

    I agree with you about the play button on the toolbar, it's lacking in thought at the moment. I'll have to think about how to design it.

  • SimeonSimeon Admin Mod
    Posts: 5,417

    @Andrew_Stacey that's odd, I'm not seeing the reports (maybe they haven't come in yet). If it's a project you don't mind sending, I'd be happy to test it out and see what's crashing.

    There should be quite a few stability improvements in the next build, I've noticed parameter.watch() and the output pane can be quite buggy in the current build. So if you are using those then it might be related.

  • Posts: 2,161

    @Simeon the project is this one: https://gist.github.com/loopspace/8511991

    It could well be the parameter.watch. I think I've removed them in that gist - in part because they aren't much use right now due to earlier mentioned issues - so you might have to add in a few random ones. I'll see if running it without parameter.watch helps.

    (Is there something I need to do or should do to ensure you get reports?)

  • Posts: 505

    I mean when you go back from details to sprite() sprite is focused, but if that is intentional then ignore my comment. :)

    To match iOS 7, it maybe should just say Play.

  • edited January 2014 Posts: 505

    A bug: trying to show this image with sprite() or as a texture makes codea crash.

    https://dl.dropboxusercontent.com/u/9710463/web/Codea/Slices.png

    Must confess I still don't understand how Codea handles retina images, and why there is a difference, so might be that it is double the size and crashes since the texture is to big?

    (was trying out my old brute force volume renderer. )

  • SimeonSimeon Admin Mod
    Posts: 5,417

    @tnlogy I can see the crash log relating to Slices.png, it has failed to load the image for some reason. When I try it here, it works. How did you get Slices.png into Codea?

    @Andrew_Stacey I'm not sure why I am not seeing your crash logs, they are supposed to come through automatically. I will try your project.

  • SimeonSimeon Admin Mod
    Posts: 5,417

    I see, can you perhaps check the Slices.png in your Codea Documents directory using iTunes (app file sharing) or iExplorer?

    It's looking for the following file and is not able to load it:

    /var/mobile/Applications/A5188B5B-0F1B-4BB3-932D-B53A3C398D8C/Documents/Slices.png

    It would take an @2x version if it was there too.

  • Posts: 505

    Sure I'll check it when I'm back from work.

  • BortelsBortels Mod
    Posts: 1,557

    Hey guys - sorry, been buried with work (building out 2 new datacenters, been doing 60+ hour weeks arguing with Cisco and Netapp and VMWare, oh my!), but glad to see a new beta coming down the pipe. I'll try to monkey with it soon - I actually have it in my head to do some lua bindings and use it to remote-control my vmware stuff (that should scare the piss out of some of our security guys!). My job used to take 20% of my brain - and I could devote the rest to hobby stuff. It's taking 99% now, sigh. It's good - learning crazy stuff - but whoa, busy.

    Quick question while I'm here - any concept of supporting ios7 controllers? I honestly don't know the API, I'm hoping just hooks to the events would be sufficient. This is what put it in my mind: http://www.idownloadblog.com/2014/01/19/controllers-for-all-a-must-have-tweak-that-brings-ps3-controller-compatibility-to-ios/

    Simeon - anything that makes projects more sharable is 100% good. Indeed - some way to export a project including all dependencies (not just shaders, but other local files and graphics) would be useful - It brings me back around to the "Codea Player" concept you had before (Codea without the editor - basically, drop project bundles into it, ideally universal, my iphone needs love). NO idea if Apple would flip their gourd or not about that nowadays. I don't know if the runtime release derailed that or not, but the learning curve to making an app with xcode is a deterrent, as is the whole get-it-released thing.

Sign In or Register to comment.