Surface Texture width on android devices problem

M

m_beytekin

Guest
My game resolution is 1280x720 and I use some post screen fx for bloom and fade effects.
when I use surfaces and shaders I realized that my surface's texture width is 0.62 x 0.7 on android device.
Because device creates a screen texture size 2048x1024 instead of 1280x720 .
That is why when I copy surfaces or using post screen shader effects it uses 2048x1024 size surfaces I guess. This causes fps drops.
How can I draw partly surfaces and shaders with real size of my screen?

I follow some methods like :
in shaders;
I check everytime texture coordinates x and y values are over texture width (0.62 and 0.7 for example) and if over then discard it.
for drawing surfaces I created own vertex format and draw surfaces with vertex submit. but nothing changed.

When I change my view size to smaller than 1024x512 fps increases very much ..

I hope I could tell my problem. Any advice about this situation?
 

RangerX

Member
Here's the logic of you need to do:

- Create the surface (or use the application surface) at 1280x720
- Draw your stuff
- Apply shader
- Draw the surface scaled at the right size

What seem to happen for you right now is that GameMaker scales your surface (do you have the "keep aspect ratio" option checked in the graphic tab?) so this makes your surface bigger already before your apply your shader and draw your things.
And don't expect surfaces to run fast on cheap mobiles. Your surface is already BIG. Are you making some crazy high res game the kind Rayman Legends or something? Depending your graphical style, there's a whole lot of chances your surface is too big for good and unable to run good on many mobiles.
 
M

m_beytekin

Guest
Thank you for your answer. My problem is not scaling. Problem is some android devices use round up view surface size to closer power of 2 values and game maker's gm_basetexture size changes to this bigger power of 2 surface. What about view surface texture size is 0.6 x 0. 72 ? This causes wrong results for some shaders which use coordinate based actions like vignette or lens distortion...
 

RangerX

Member
I told its because you have "keep aspect ratio" checked on in the global settings of your target.
This means GameMaker will take whatever application surface you have and resize it up/down to fit as much space as possible in the device's screen. That must be why your app surf isn't 1280x720 anymore when you play in the phone/tablet.
 
Top