Comments (9)
Don't want to. Atlases will become mostly obsolete when I finally get to adding mutlitexture and texture array support in G2onG4 plus atlases are problematic with mipmaps which I want to support, too. Sorry.
from khamake.
Image object have rectangle info in runtime
That's most likely unnecessary bloat for every image, even if it isn't on an atlas.
Add build time atlas generator from npm with some define
You should be able to add that already via project callbacks in your khafile.
And people don't need to change
drawImage/drawSubImage/etc
calls toAtlas.drawImage(g, "imageId", x, y)
or something.
using MyG2AltasExtension;
g2.drawAtlasImage(...);
Is actually much clearer to me.
Thoughts?
Sry, doesn't belong here IMO.
from khamake.
@sh-dave it only adds var x:Int; var y:Int
offset in image object if there is atlas define, i think, and this little overhead should be optional. With personal Atlas class you still need to change every api, based on kha.Image
and pass instead imageId:String
and rectangle array/object. Even without mipmap support this feature will be useful for 2D with opengl < 3.1, where multitexturing has appeared?
from khamake.
Multitexturing is available in ES 2 which can mitigate the need for atlases greatly. ES 3 supports texture arrays which makes atlases completely obsolete - and that's 80% of current Android devices and basically 100% of everything else (minus some Linux systems).
from khamake.
Cool, I'll be waiting for this stuff. Is there a separate issue?
from khamake.
For something decent it would also need at least: w
, h
; additionally cropped variants for x
, y
, w
, h
and maybe even rotation
.
With personal Atlas class you still need to change every api, based on kha.Image and pass instead imageId:String and rectangle array/object.
I don't get what you mean by that. Just call g2.drawYourStuff(region, x, y);
instead of g2.drawImage(img, x, y)
?;
from khamake.
Aren't texture arrays limited to same size textures?
from khamake.
True, I tend to forget that. I'll see what I can come up with when I combine texture arrays and multitexturing. I'll probably start with bindless textures and work my way down.
And no, there is no issue about that other than all the issues in/with my head.
from khamake.
Just call g2.drawYourStuff(region, x, y); instead of g2.drawImage(img, x, y)?;
Yep, but i get images sometimes with Assets.images.get("imageId")
, so you also need StringMap of regions.
kha.Image
already have h/w
, so that's enough. True about rotation for complex atlases tho. Example of implementation:
#if kha_atlas
public static function drawImage(g:Graphics, image:Image, x:Float, y:Float):Void {
g.drawSubImage(atlas, x, y, // real drawSubImage for short
image.x, image.y, image.width, image.height
);
}
public static function drawSubImage(
g:Graphics, image:Image, x:Float, y:Float,
sx:Float, sy:Float, sw:Float, sh:Float
):Void {
g.drawSubImage( // real drawSubImage for short
atlas, x, y,
image.x + sx, image.y + sy,
sw, sh
);
}
#end
Ideally, with #kha_atlas
, all Image objects refer to the data of a single image, but have their x / y / width / height
. Anyway, I'll try to use khamake callbacks and add x / y
to the imageDescription
files, but using a separate rendering class.
from khamake.
Related Issues (20)
- Chokidar ignore assets and shaders when the path contains a "." HOT 7
- [addProject] assets exported to wrong path
- [addProject] nested addProject calls don't seem to work
- Resource busy or locked HOT 5
- Source code not recompiled on change HOT 11
- project.addAssets with absolute path fails
- --haxe3 doesn't work with --watch HOT 3
- Automate kha_version define HOT 5
- Issues Building With Latest Khamake+Koremake HOT 13
- addAssets('../Assets/**') not including files HOT 3
- A library's addDefine gets ignored HOT 1
- Chokidar v3 request
- Shader compiler error writes to log.info() instead of log.error()?
- A library's full path is used for addDefine
- khafile.js -> await project.addProject("xyz") breaks code-completion (haxe doesn't build cache anymore) HOT 5
- CLI flag grep compat
- Should return non-success error code on compilation failure
- Store/query mapping from original asset filenames to renamed/converted asset filenames
- Khamake silently ignores khafile.js errors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from khamake.