Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / SetImageWrapU / SetImageWrapV

Author
Message
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 19th Sep 2018 07:19 Edited at: 19th Sep 2018 09:41
Hi

In a previous version of AGk, we can use SetImageWrapU / SetImageWrapV with an image without power of 2.

Now, it's no more possible


it's not possible to have all my images with power of 2, because I need specific size for some images.
and my fps is going down if I make that.

Before (a previous version of agk), it worked with images without power of2 :


and now, it doesn't work at all



Do you know if there is a way to repeat an image on a sprite without power of 2 ? (shader or any solution) ?

How to do a parallax effect with rectangular image (800*200) ?

Thanks

Edit :
I have try to change some image (800*200) in 1024*1024 but my fps was 60 and now it's 15.
AGK2 tier1 - http://www.dracaena-studio.com
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Sep 2018 08:56
1. have you tried 1024x256?
2. maybe you could just have 3 sprites and when one goes off screen move it to the other side
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 19th Sep 2018 09:39
Why would it cause an FPS drop like that? Sounds like you're doing something wrong.
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 19th Sep 2018 15:57 Edited at: 19th Sep 2018 15:59
This is still possible but Im not sure what you have done wrong without looking at your code??

A wrappable texture just needs to be a power of 2 on each axis....so a 1024x256 is wrappable! It doesnt need to be the same dimension on both axis

Also take a look at:
SetDefaultWrapU() and SetDefaultWrapV() - set them both to 1

They can work even when the SetImageWrapUV() Functions dont work. Whether they work depends on if your mimapping or not (Have you set SetGenerateMipmaps(1)?? - looks like you have from the smoothness of the graphics - if you havent....just using The default wraps will fix this)

Another option is to load your 800x200 image and simply add the line

ResizeImage(img,1024,256) - then turn wrapping on and it will work fine

If your still struggling after that then a VERY easy shader would fix the issue for you

Heres your graphics wrapped on a non power of 2 sprite image


This is ONE sprite with SetSpriteUVScale(spr,0.33333,1.0) to produce the wrapped effect so it is doable but takes a bit of care.

Login to post a reply

Server time is: 2024-11-23 16:10:20
Your offset time is: 2024-11-23 16:10:20