Forum Replies Created
-
AuthorPosts
-
Very cool! Seems like a good start for some kind of exploration-intensive game.
Getting 5ms / 200 FPS on Safari, Macbook Pro laptop.Works now. Thanks!
Is it gonna be added as one of the “bananas” examples?Just tried, and I’m also getting “no default constructor” errors with V1.1.03.
[/crayon]Monkey123456[crayon-5cba9dad7710d269446795 inline="true" ]: Error : Super class 'std.collections.List<default.Special>.Node' has no default constructor: Error : Super class 'std.collections.List<default.Special>.Node' has no default constructor: Error : Super class 'std.collections.List<default.ParticleA>.Node' has no default constructor: Error : Super class 'std.collections.List<default.ParticleA>.Node' has no default constructorThanks Mark! Updated.
Also added full transformation support for render items (position, rotation and scale).One thing I could not get working yet is the “colors” argument. I tried passing a Uint stack populated with Color.ToARGB(), with pitch 4, but I just can’t get it to look right, and not sure what I’m doing wrong. I left those lines commented out in the Github code.
Cheers.
Switched the drawing to Canvas.DrawPrimitives and… Wow!
On the discreet GPU I’m getting 2 to 3 times faster, and on the slower laptop with Intel integrated GPU it’s a whopping 15 to 20 times faster!
I made a simplified version of my new RenderStack class, without any references to entities or drawing matrices (which means you can only draw non-rotated quads), and uploaded a simple example to GitHub if anyone is interested. It automatically generates the batches, accumulating render items that share the same texture until it tries to draw an item with a new texture (in this example all images share the same texture, so a single batch is drawn).
https://github.com/DoctorWhoof/RenderStack
Feel free to improve and share.The only bummer is that this example will crash if you set the total number of drawings too high – definitely crashes at 20000, so the difference between batching and not batching is not that clear. But in my project using much larger image atlases (with hundred of tiles) the difference is massive.
Cheers!
I just remembered I don’t know how to get the Device’s dimensions, which makes my suggestion hard to test…
I also don’t know how to get the letterboxed dimensions, using Window.Width and Height seems to return the Window size, not the “cropped” size.
Any clues on how to do those things?
I do think it would be useful, allowing one of the axis to be preserved while the other one increases/decreases in size as needed, effectively changing the aspect ratio. I also had that working in Monkey1, but haven’t done it in M2 yet.
I’m away from my laptop now, but maybe you can use Window.OnMeasure() and adjust the virtual resolution to always match the aspect ratio of the device? Simply return a new Vec2i with the desired virtual resolution that matches the device’s aspect. Will try later tonight.
Thanks!
DrawPrimitives seems like the way to go.I also found another inefficient bit: my RenderStack object, which does the y-coordinate sorting I need (so that sprites may be drawn in front of or behind objects, depending on the screen placement) accounts for almost half of the drawing time. Here’s the code for that:
Monkey12345678910111213141516Method Draw( canvas:Canvas )Echo( "RenderStack: " + items.Length + " items", False )items.Sort( Lambda:Int( a:RenderItem, b:RenderItem )Return a.depth <=> b.depthEnd )For Local r := Eachin itemsr.entity.TransformDrawingMatrix()canvas.DrawRect( r.left, r.top, r.width, r.height, r.img )canvas.PopMatrix()Nextitems.Clear()EndIf I comment out the canvas.DrawRect line, the images aren’t drawn but it still takes 1 ms (from the original 2 ms) to sort the stack and transform all coordinates.
Turns out the r.entity.TransformDrawingMatrix() is a repeat operation – I can store each item with the coordinates already transformed. Now I only have to figure out a quicker way to sort the drawing queue. Maybe sort as I insert the items in the stack, instead of all at once?
Thanks.
The theme font wouldn’t even be an issue if the font could be selected from within the IDE.
Yes! I understand a Theme being able to “suggest” a font, but the user should be able to override it.
is this default-ted + new colors, or this is hezkore+new colors ?
I started with Hezcore’s theme, but ended up extending Default Ted because I wanted the monospaced fonts.
Here’s a new theme for you! Mostly warm colors, so it goes easy on your brain at night.
JavaScript12345678910111213141516171819202122232425262728//Golden Theme by Ethernaut, vaguely based on "smooth" by Hezcore{"extends":"ted2-default","colors":{"border": "#211d12","clear": "#23211f","gutter": "#242324","content": "#282728","panel": "#594f45","knob": "#363330","hover": "#594f45","active" : "#7e7763","textview-cursor":"#FFDD55","textview-selection":"#3E4451","textview-color0":"#f2dba6","textview-color1": "#f6e4bc", //identifiers"textview-color2": "#ffbf00", //keywords"textview-color3": "#cbcb4d", //strings"textview-color4": "#66b3cc", //numbers"textview-color5": "#8E744A", //comment"textview-color6": "#729888", //preproc"textview-color7": "#fff9e6" //default}}And here’s how it looks:
Attachments:
Whoah! That looks incredible! Can you control Sunvox Ok without a keyboard And mouse?
Awesome updates!
On the MacOS front, here’s what I found:The shortcut to remove comments, Command+Shift+/ is already reserved for the OS (It’s the same as Command+?, brings up the “About” dialog). Command+Alt+/ is not assigned to anything, could be a good option. Ideally, though, it should be a toggle (the same shortcut comments, and if already commented, removes the comment).
Command+Arrows (home/end) works! But Alt+Arrows (navigate to previous/next word) doesn’t. Selecting it from the menu (Go Back/ Go Forward ) doesn’t do anything either.
Changing themes changes the bg colors, but doesn’t apply the text colors right away, only after restarting the app.
Cheers!
Screenshots look good!
Couldn’t try it, since I don’t have any Android device. Does it work anywhere else?gles3 would be unnecessary for 2D, but super cool for a 3D module.
Would it be possible or desirable to keep 2D and 3D separate like that? -
AuthorPosts
