@Ignatz I think I understand what you’re saying about tabs now. Each tab would be an increasing complexity of the code.
I also have reservations about black box code, and managing it does use up a lot of the debug area at left - but it does make copying and pasting so easy.
Another way to handle multiple tabs is to use block comment tags to comment out all the code in all the tabs except the one on the left. Then to use one of the other tabs, the user only has to delete one ] at the top. A little clumsy, I know, but probably as simple as sliding tabs around.
@dave1707, the reason for multiple tabs, is that for say, meshes, it is a good idea to start very simply and work up. If you have a series of separate projects labelled Mesh1, Mesh2, etc, and you do this for each major feature, I leave it to you to figure out how horribly long the eventual list of apps will be. Unless Simeon can put groups of apps in “sub folders” to keep it clean.
@loopspace - you haven’t even seen my quaternion demo yet, you never know, you might learn something [ducks hastily] . It may be a bridge too far, and certainly not a priority, but I thought I’d put them on the list initially, because quaternions are so useful for flying apps. Let’s do all the important demos first, though.
That’s right.
I call them “step by step” projects.
But I think we should try to be consistent in how we handle multiple tabs.
Also on the subject of unused assets, I think there should be example programs using the built-in shaders (just very simple ones), as it’s not necessarily clear to the beginner, just from looking at the bindings tab in the shader lab, how to actually incorporate the shader into code.
Looking through the forums, you can often find example code that does this. There are wrappers for the arc shader and the Mandelbrot shader for instance. Perhaps these could be collated into a single shader lab project?
Yes, I think it would be a good idea to have a library of useful shaders in different tabs of a single project to facilitate copying (I wouldn’t include mandelbrot though, I don’t see any use for that except in a mandelbrot program).
Here is my step by step shader project, which keeps things pretty simple
A really useful shader would be a tile map shader that takes something like a tiled output and then renders it on a single rect - that would really make a big difference to rendering on platform games.
Actually I was thinking more like this - http://blog.tojicode.com/2012/07/sprite-tile-maps-on-gpu.html
Your shader is great but it just replicates the image across the quad, the link above actually takes a full map and renders that.
It can certainly be done, but I’m not sure it’s going to be faster
@TechDojo that’s an interesting idea and certainly possible in Codea, but I wonder whether it’s faster than a conventional texture atlas approach, ie all background sprites in one texture, the entire background as a bunch of rects on one mesh. Sure, the conventional method has a lot more geometry (but still not enough to really slow things down, eg a screenful of tiles would be 16 * 12 * 6 = 1152 verts), but this method has more complex fragments (2 texture samples in each fragment). I’d be interested in seeing the 2 approaches profiled side by side.
Hello! Here is my proposal of blenmode tutorial.
http://www.youtube.com/watch?v=K2t1gwWuB9U
code: https://gist.github.com/anonymous/c44e36b27c5e85066edd.
[edit] use this link instead:
https://gist.github.com/anonymous/dd8a65d353a679e53bf1
(i introduced a nicer slider to switch between slides).
[edit] i’ve noted some inconsitancies in the notations between slides, i’ll correct that.
[edit] version with nice sensor class https://gist.github.com/anonymous/42e8b083a70bd36a1f2a
Cool, thank you. I’ll have a look at it.
@Jmv38 - that is a totally awesome tutorial with so much extra goodness! A new way of doing multi tab projects (with individual tabs which can be copied easily into new projects), and swipe transitions, and drop down selectors on your last demo, too!
I suggest you add a brief description for each demo to the text in the slider bar at the right, i.e. instead of “Demo01”, say “Demo01: normal color blending”, so if someone comes looking for something specific, they don’t have to flick through all the demos to find it.
A few typos to correct:
Demo01 - “independent” not “independant”, and “default” not “defaut”
Demo06 - “overlapping” not “overlaping”
Demo10 - “subtracting” not substracting", “green” not “geen”
Demo12 - overlapping again
Demo17 - “subtractive” not “substractive”
What an amazing effort, well done! You have set a very high standard with that demo.
^:)^
I’ve created a page to hold new demo apps, in the wiki
https://bitbucket.org/TwoLivesLeft/core/wiki/Codea%20Demo%20Apps
(by the way, it’s not just about demos, it’s about apps that show what Codea can do as well).
@Ignatz i’m quite pleased you liked it that much! Thanks.
I agree with your suggestions (i thought the same about the slider, but it needs some architecture choices to implement that, so i procrastinated…), and i’ll post a corrected version.
Otherwise maybe just print a list of demos in the output area at the left
it’s ok i finally just changed the tab names, they can be named anything.
latest version [edit] https://gist.github.com/anonymous/352a8fef0dee0814cee9
Here is my first attempt at a more detailed mesh demo, something I think is badly needed.
It’s unfinished, but I thought I’d share it to see what you think so far. It’s aimed at users who can use sprites and want to go to the next step of using meshes.
Is it pitched at the right level? Is the pace ok? Is it clear? What suggestions do you have for further steps?
Note I am using the same method used by @Jmv38 in the demo he posted above. It is very compact, and allows you to set up complete demos in separate tabs in any order you like, and the Main tab just handles them. It’s a great way of building step by step demos, and all you need to start using it yourself, is the Main code, which you should always put on the extreme right.
it looks good. I would introduce setRect() function to make rectangles, though.
Yes, that’s my next step, thank you