Open SET001 opened 4 years ago
default mode in current (v5) implementation doesnt depend on that limitation.
As soon as you specify
PIXI.tilemap.Constant.boundCountPerBuffer = 4;
RMMV behaviour kicks in and starts combining 4 textures into one big.
There are other constants. Please look at them. In v4x its by default, but you can easily switch it off.
But then, of course, you need to raise number of used texture units.
well, what I'm trying is to change in atlas frame coordinates to out of 1024x1024 range:
"collon7": {
"frame": {"x":1728,"y":384,"w":32,"h":32},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":32,"h":32},
"sourceSize": {"w":32,"h":32},
"pivot": {"x":0.5,"y":0.5}
}
If I do so, this frames just does not show up. Also, I put boundCountPerBuffer =4
in the very beginning of index file
import * as PIXI from 'pixi.js'
(window as any).PIXI = PIXI
PIXI.tilemap.Constant.boundCountPerBuffer = 4;
versions used:
"pixi-tilemap": "^2.0.0",
"pixi.js": "^5.1.5",
with
"collon7": {
"frame": {"x":992,"y":384,"w":32,"h":32},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":32,"h":32},
"sourceSize": {"w":32,"h":32},
"pivot": {"x":0.5,"y":0.5}
}
and with:
"collon7": {
"frame": {"x":1024,"y":384,"w":32,"h":32},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":32,"h":32},
"sourceSize": {"w":32,"h":32},
"pivot": {"x":0.5,"y":0.5}
}
this is the tilemap I'm using
boundCountPerBuffer =4
Default mode in v5 should work, you dont need that line.
Please make a small demo for me, I'll debug it.
This is the line that makes pixi-tilemap work with any textures: https://github.com/pixijs/pixi-tilemap/blob/master/src/Constant.ts#L7
And here is it in build: https://github.com/pixijs/pixi-tilemap/blob/master/dist/pixi-tilemap.js#L206
pixi_tilemap.Constant = {
maxTextures: 4,
bufferSize: 2048,
boundSize: 1024,
boundCountPerBuffer: 4,
use32bitIndex: false,
SCALE_MODE: PIXI.SCALE_MODES.LINEAR,
DO_CLEAR: true
};
Well, it seems that I forgot to publish the build :)
OK, I re-published it in dist
folder, please take a "new" one. I dont know how did that happen.
published 2.0.1 in npm.
I have updated to 2.0.1 and it was finally solved when I added
PIXI.tilemap.Constant.boundCountPerBuffer = 1
If I change it to 4
then tiles that are out of 1024x1024 range would again be not visible
I have changed to 1 too. I render texture render amount to be 40876 and it breaks in the middle around 1xxxx in the webgl.
@jjhesk look in readme, it has special setting for uint32 stuff
thanks. i got it resolved @ivanpopelyshev
is it possible to somehow hack the 1024x1024 texture limitation? I'm currently using 2048x3040 and the tiles outside 1024x1024 is just ignored.