D
Deleted User
Guest
I wasn't precise, sorry[emoji28]Probably H flip and V flip to mirror the texture.
That's exactly what i wanted to mean.
I wasn't precise, sorry[emoji28]Probably H flip and V flip to mirror the texture.
Are you talking about this?I wasn't precise, sorry[emoji28]
That's exactly what i wanted to mean.
Sorry but I'm getting my post again, I need to nail the 3d for a project I'm working on.I'm not getting very definited borders in 3d mode with images loaded with libsfil. It's a known issue or it's my fault?
The X displacement for my stereo pair ranges from 0 to 10 pixels (increasing on the GFX_LEFT) depending on the 3d slider state.
I am seeing ghostly edges in the x axis for an alpha enabled png loaded with libsfil.
Probably H flip and V flip to mirror the texture.
Compiles made by this commit are crashing but d9147df works fine. It seems to be the new "int tex_filters" in the struct, I had to move it to the end of the struct to get anything to run. I converted it to u32 for good measure too.
Edit: is it just me or are the filters pretty useless? There's not much difference between them that I can notice.
Edit 2: Forget that, I see what elhobbs was saying now. You need to send the other params along with the min mag filters.
eg.
rename to params
changed from int to u32
sf2d_texture_set_tex_filters(sf2d_texture *texture, u32 filters)
texture->tex_filters =
so you use it like this:
sf2d_texture_set_tex_params(tex,GPU_TEXTURE_MAG_FILTER(GPU_LINEAR)| GPU_TEXTURE_MIN_FILTER(GPU_LINEAR)|GPU_TEXTURE_WRAP_S(GPU_REPEAT)|GPU_TEXTURE_WRAP_T(GPU_REPEAT))
It's MUCH nicer for scaling old DS games up from 256*192 but I now need to render to a temp buffer as the alignment goes out a bit when I scale. I think it's because you convert from a float for scale into sizes then back into a float so it's losing data. I'd actually prefer if we could send width and height in px instead of a float as they tend to add decimals randomly.
You can use the scaling function and pass negative values to it (this will mirror the image), or you can use the sf2d_draw_quad_uv function to have more control about how the image will be drawn.Exactly.
Try now, I've changed the default texture wrapping to GPU_CLAMP_TO_BORDER.Sorry but I'm getting my post again, I need to nail the 3d for a project I'm working on.
Try now, I've changed the default texture wrapping to PU_CLAMP_TO_BORDER.
That's weird, your PNG crashed, but I've tried with another PNG and it works. Try resaving your png with GIMP or something similar.Still the same.
Attached test code.
typedef struct {
sf2d_place place; /**< Where the texture data resides, RAM or VRAM */
int tiled; /**< Whether the tetxure is tiled or not */
sf2d_texfmt pixel_format; /**< Pixel format */
int width; /**< Texture width */
int height; /**< Texture height */
int pow2_w; /**< Nearest power of 2 >= width */
int pow2_h; /**< Nearest power of 2 >= height */
int data_size; /**< Size of the raw texture data */
void *data; /**< Pointer to the data */
u32 params; /**< Texture filters and wrapping */ <<< ---- HAVE TO MOVE IT HERE ELSE CRASHES
} sf2d_texture;
Are you recompiling sf2dlib as well? When ever you change a struct, you should recompile and re-install sf2dlib. If your code tries to access a different version of the struct that sf2dlib is compiled with, you'll get segmentation faults from values being modified in the wrong places in memory (like overwriting void*data with an arbitrary value).So I updated and I can't run my compiled binaries again. I've had to move the u32 params to the end of the struct else my 3DS and citra both freeze up. Citra throws unmapped memory errors.
I've seen this a before but it seemed to rectify itself when I tested updating my libs 2 days ago. Any ideas why it's doing this? I'd rather not change stuff like this all the time.
Code:typedef struct { sf2d_place place; /**< Where the texture data resides, RAM or VRAM */ int tiled; /**< Whether the tetxure is tiled or not */ sf2d_texfmt pixel_format; /**< Pixel format */ int width; /**< Texture width */ int height; /**< Texture height */ int pow2_w; /**< Nearest power of 2 >= width */ int pow2_h; /**< Nearest power of 2 >= height */ int data_size; /**< Size of the raw texture data */ void *data; /**< Pointer to the data */ u32 params; /**< Texture filters and wrapping */ <<< ---- HAVE TO MOVE IT HERE ELSE CRASHES } sf2d_texture;
That's weird, your PNG crashed, but I've tried with another PNG and it works. Try resaving your png with GIMP or something similar.
Also, sf2d_swapbuffers() already does the vblank wait (so you can remove the gspWaitForVBlank(); call) unless you disable it with sf2d_set_vblank_wait(0);
Yes I recompiled with a make clean first. It works when I change the struct which is really odd. I'll try deleting my sf2d folder and start fresh from the latest commit.Are you recompiling sf2dlib as well? When ever you change a struct, you should recompile and re-install sf2dlib. If your code tries to access a different version of the struct that sf2dlib is compiled with, you'll get segmentation faults from values being modified in the wrong places in memory (like overwriting void*data with an arbitrary value).
You would need to make sf2d before compiling you project. And possibly install it too.Yes I recompiled with a make clean first. It works when I change the struct which is really odd. I'll try deleting my sf2d folder and start fresh from the latest commit.
Thanks
Not possibly install it, definitely install it!You would need to make sf2d before compiling you project. And possibly install it too.
Not possibly install it, definitely install it!
I deleted my sf2d folder and re-downloaded the latest commit (a8fb32a) but it still fails in citra and on my 3ds. I attached from screenshot of citra but I'm not sure if it will help much. The error goes on forever.
View attachment 30042
Like I said before, if I change the position of the params to the end of the texture struct and recompile, everything works again. I tested the pointer to the data and I moved it to the start of the struct after moving the params to the end and that has the same issue. Is there a bug with the data pointer in texture struct maybe?
I also had the same problem when I first set up the dev environment on the previous page of this thread so I was using an old version of sf2d to get by. It resolved itself with d9147df
Weird, it's working here :/ Can you upload the code you are trying?
I'm currently having some difficulties with libsftd, since I can't install portlibs nor zlib (all info that I've found about installing them is for Linux, and I'm currently running Windows 10)...
Any other way to display text with sf2d without any problems on Windows?
After three hours of installing...It does it with the sample too for me. About all I can do is to send you the compiled binary that doesn't work which would need reverse engineering against one that does work to see what is different.
I'm using win7 and managed to install the portlibs. It took a while to find something that worked properly and it took a few attempts to do it. Maybe this is my problem and something in the portlibs didn't install properly.
Try messing about with these, it eventually worked for me:
https://gbatemp.net/threads/can-someone-zip-the-3ds-portlibs-for-me.392966/#post-5577623
https://github.com/xerpi/3ds_portlibs
After three hours of installing...
Did it installed correctly? It created all the folders from the portlibs.
are you trying to build this in the portlibs directory under devkitPro? don't do that.After three hours of installing...
Did it installed correctly? It created all the folders from the portlibs.