Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,089 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[MED] Skin editor texture coordinate distortion #370106
05/11/11 00:06
05/11/11 00:06
Joined: Mar 2010
Posts: 75
YellowAfterlife Offline OP
Junior Member
YellowAfterlife  Offline OP
Junior Member

Joined: Mar 2010
Posts: 75
Reproduction:
1. Open MED
2. Open Skin Editor
3. Import a small (for the best effect, <16px) skin
4. 'Enjoy' - half of pixel at each side of texture is not taken into account.

This effect is the most noticable if you will try to wrap a cube with 4x4 texture. This is how it looks:

Notable thing is that preview window displays texture correctly - it's only a bug in 'textured rectangle' drawing on left side.
A image of 8x8 image (just the same one tiled 2x2) can be seen below. For better comparsion, I replaced one quarter of texture with a stretched version of original image (that is aproximately how it should look):


While this is not a critical bug, it causes (different) precision loss when mapping models with MED.
Models with large textures barely suffer from this, while on small textures it may confuse the viewer about placement of contents (vertices and triangles), causing one to re-arrange them and find out that they don't match on 3d model now.


Unfortunately, I've not worked with 3dGS for a while now, but it was fun
Re: [MED] Skin editor texture coordinate distortion [Re: YellowAfterlife] #370149
05/11/11 10:47
05/11/11 10:47
Joined: Apr 2008
Posts: 2,488
ratchet Offline
Expert
ratchet  Offline
Expert

Joined: Apr 2008
Posts: 2,488
Just use a Blender ,Wings 3D or any free modeler if you plan to make
Low Poly stuff laugh

Re: [MED] Skin editor texture coordinate distortion [Re: ratchet] #370290
05/12/11 08:48
05/12/11 08:48
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
As you see, editing 3D models is sometimes not as simple as it seems.

The reason for that strange cutting off half the pixel is the way how 3D engines map textures to surfaces. They always render from the center of the first to the center of the last pixel. Thus the render area is one pixel smaller than the actual texture size. For compensating this, the texture scale is a little enlarged.

If the engine would render from the start of the first to the end of the last pixel, as one would normally assume, the surface would get visible seams because the last pixel mixes with the first. So for displaying mapping you must always make a compromise. The 2D window shows the correct mapping, even if it may look strange to you.

Re: [MED] Skin editor texture coordinate distortion [Re: jcl] #370304
05/12/11 10:55
05/12/11 10:55
Joined: Mar 2010
Posts: 75
YellowAfterlife Offline OP
Junior Member
YellowAfterlife  Offline OP
Junior Member

Joined: Mar 2010
Posts: 75
Originally Posted By: jcl
As you see, editing 3D models is sometimes not as simple as it seems.

The reason for that strange cutting off half the pixel is the way how 3D engines map textures to surfaces. They always render from the center of the first to the center of the last pixel. Thus the render area is one pixel smaller than the actual texture size. For compensating this, the texture scale is a little enlarged.

If the engine would render from the start of the first to the end of the last pixel, as one would normally assume, the surface would get visible seams because the last pixel mixes with the first. So for displaying mapping you must always make a compromise.

Probably transforming texture coordinates accordingly or not displaying that last 1/2pixel would be a better solution?
Originally Posted By: jcl
The 2D window shows the correct mapping, even if it may look strange to you.

Topic can be closed if you'll say how this happens to be correct mapping in 2d window:

All editors but MED skin editor display texture in the same way.

Last edited by YellowAfterlife; 05/12/11 10:56. Reason: Linked image

Unfortunately, I've not worked with 3dGS for a while now, but it was fun

Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1