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.

Newcomers AppGameKit Corner / SetObjectUVScale is causing weird rendering while moving

Author
Message
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 5th Aug 2017 01:38
I am not sure how to explain what is going on.

When I use SetObjectUVScale and move its like the image is constantly in flux while I am moving. I tried to search for this, but nothing came up.

Once I stop moving everything looks great. It only happens on objects that I have to use setobjectuvscale. Like walls and the ground.

Thanks!
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 5th Aug 2017 02:59 Edited at: 5th Aug 2017 03:17
I messed around with it a bit. I am not sure why, but when I scaled down the image(from 1024 to 256) this was a huge fix. I am not sure why.. there is almost zero "glitchyness". I think I am going to try 128 and see what happens...

I think the best performance was at 128x128, but the quality difference was noticeable. I also tried 64x64, which took way too much of a quality hit, but performance was the best. I believe I will stay at 256. I really didn't notice a difference in quality(I'm sure it was there I just didnt notice).
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 8th Aug 2017 22:59
Depends on what / why you are scaling.
Are you adjusting the scale constantly?
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 13th Aug 2017 15:22 Edited at: 13th Aug 2017 20:45
No. I set it to my walls and floors(that are scaled from 2x2). It looked like the images were overlapping each other(like when two objects overlap), but it only happens when I move.

Then when I put in normalmaps it got really bad anytime I would move.

I just found that SetGenerateMipmaps(1) got rid of it, but the quality is impacted. I am going to go back to using the larger textures to see if that brings back the quality.


Going back to a 2048 texture had no impact. The quality is really poor with setgeneratemipmaps.

I believe my only solution is to not scale the walls or floors, and texture them in blender. I'll just have to make various size planes and walls.
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 15th Aug 2017 01:03
Ah. You might have a different problem.
You might have z fighting (or whatever some people call it)

If you have 2 textures at same depth, then they will "fight" for priority.
Solution is to not place items at the same Z, or to use the Z priority settings.

Scaling textures on their own shouldn't be an issue like you say. Perhaps a video of what you see may help us?
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 15th Aug 2017 02:04
I will make a video, nZO. I just need to find a decent program. The default windows one sucks, and I don't think you could see it. I will try to get one out this weekend.

Thanks for your help. You're a great contributor to us newbs.
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 15th Aug 2017 02:10
Unless you have an nvidia gpu, try bandicam
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 16th Aug 2017 00:37 Edited at: 27th Aug 2017 14:33




Mip Maps = https://youtu.be/dDkaa15QQ9w

No Mip Maps = https://youtu.be/0CM1nHCzrqI

Sorry, apparently embedding videos is not very intuitive, and , of course, search brought up nothing.

And I just saw the quality is atrocious. Its fine on my computer until I upload it to youtube.
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 16th Aug 2017 00:58
A friend of mine calls this the "ants effect"

If you are using a normal map/lightmap or something and you altered the uvscale on the diffuse , you must match it on the other textures.
It would follow that if you reduced the resolution of the texture as there would be less "differences".
If this isn't the answer, then you would need to post a simple wall object example complete with textures and stuff.

MipMaps should be fine, but I would like to know the distance formula that AppGameKit uses for switching to the lower res versions, unless OpenGL handles it.
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 16th Aug 2017 01:09 Edited at: 16th Aug 2017 01:13
Haha, I like the "ants effect".

Matching the scale for the normalmap actually makes it far worse. It somehow seems to be multiplying the scale effect. So, it scales it even more. And this was a problem even before the normalmaps were added.

I fear the only solution is to not scale, and waste my time/size of the app making different size walls and textures.

I will post the object and textures. All I am doing is scaling between 3 or 4X.

Attachments

Login to view attachments
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 16th Aug 2017 01:17
Looks like you'll need to create a simple code example.
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 16th Aug 2017 12:56
Example for one floor and one wall.


nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 16th Aug 2017 18:41
This works fine for me:



I can only imagine you didn't set mipmaps on before you loaded the images?
I also switched on AA so you can see any difference with/without that.
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 16th Aug 2017 19:36
I don't have problems other than quality when mipmapping is on.
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 16th Aug 2017 19:58
So no "ants" when mipmapping is on, just a little bit blurry?

When I looked at the brick texture, it's sort of photorealistic and has some artifacts close up which probably don't help.
Try a different brick texture perhaps?
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 17th Aug 2017 00:57
Right. No problems with ants with mipmapping. Although, the floor still looks excellent. The walls look blurry.

Could it be my video card?

On another map of mine, I textured in blender instead of scaling, slowed my character's movement, and it looks really nice.

nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 17th Aug 2017 21:45
Maybe - after all it is a complex texture.
I have uploaded a video of the above running on my PC. Looks



Youtube slightly degrades it, even in HD, but is perfect locally.
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 17th Aug 2017 22:57
Looks nice! Thanks for the help nz0.
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 18th Aug 2017 01:00
So how does the video compare to running on your PC?

Login to post a reply

Server time is: 2024-04-25 05:48:53
Your offset time is: 2024-04-25 05:48:53