Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texture size limitation #70

Open
SET001 opened this issue Oct 12, 2019 · 13 comments
Open

texture size limitation #70

SET001 opened this issue Oct 12, 2019 · 13 comments

Comments

@SET001
Copy link

SET001 commented Oct 12, 2019

is it possible to somehow hack the 1024x1024 texture limitation?
I'm currently using 2048x3040 and the tiles outside 1024x1024 is just ignored.

@ivanpopelyshev
Copy link
Collaborator

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.

@ivanpopelyshev
Copy link
Collaborator

But then, of course, you need to raise number of used texture units.

@SET001
Copy link
Author

SET001 commented Oct 12, 2019

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",

@SET001
Copy link
Author

SET001 commented Oct 12, 2019

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}
  }

sssssssssssaaasd

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}
  }

sssssssssssaaasd2

@SET001
Copy link
Author

SET001 commented Oct 12, 2019

this is the tilemap I'm using
ProjectUtumno_full

@ivanpopelyshev
Copy link
Collaborator

ivanpopelyshev commented Oct 12, 2019

boundCountPerBuffer =4

Default mode in v5 should work, you dont need that line.

Please make a small demo for me, I'll debug it.

@ivanpopelyshev
Copy link
Collaborator

This is the line that makes pixi-tilemap work with any textures: https://github.com/pixijs/pixi-tilemap/blob/master/src/Constant.ts#L7

@ivanpopelyshev
Copy link
Collaborator

ivanpopelyshev commented Oct 12, 2019

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 :)

@ivanpopelyshev
Copy link
Collaborator

ivanpopelyshev commented Oct 12, 2019

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.

@SET001
Copy link
Author

SET001 commented Oct 13, 2019

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

@jjhesk
Copy link

jjhesk commented Apr 2, 2022

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.
image

@ivanpopelyshev
Copy link
Collaborator

@jjhesk look in readme, it has special setting for uint32 stuff

@jjhesk
Copy link

jjhesk commented Apr 3, 2022

thanks. i got it resolved @ivanpopelyshev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants