Jump to content


Photo

Texture problems (STILL HELP)


  • Please log in to reply
10 replies to this topic

#1 Misu

Misu

    Awesometasticness!

  • GMC Member
  • 435 posts
  • Version:GM:Studio

Posted 27 April 2012 - 06:45 PM

I have two texture problems:

1. The texture transparency is drawing its pixel. It looks very ugly (not reflecting things behind the object). I tried changing the depths from higher to lower. The problem persist and I still can't find a solution to it.
Image:
Posted Image
Posted Image

2. I made a car model with the program called "Blender". I imported the model perfectly but I want to add a texture to it but don't know how (When I tried, it came out messed up).
Image:
Posted Image

Can any one help me? :sad:

Edited by MisuMen49, 28 April 2012 - 11:34 AM.

  • 0

#2 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8246 posts
  • Version:GM7

Posted 27 April 2012 - 10:52 PM

1) The easiest and least complicated fix is to disable interpolation before drawing it, then re-enable it after.
2) Look into UV Mapping, either through Blender or a GM-made tool.
  • 0

#3 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1589 posts
  • Version:GM8.1

Posted 27 April 2012 - 10:52 PM

1. Depth-sorting or alpha-testing could solve your problem. (Sort all polygons according to distance from camera, or make all texels either COMPLETELY transparent or COMPLETELY solid)
2. If it's a texture problem, try flipping the texture vertically. Otherwise, your model may be messed up.
  • 0

#4 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14386 posts
  • Version:GM:Studio

Posted 27 April 2012 - 11:13 PM

If it was a depth problem, you would not see the background through the large gaps where alpha is 0 in the leaves.

I think your texture have the edges around the color of the leaves. It happens often when you grab textures of the web, the background of the texture is whitish and the leaf edges have a blend from green to white in the image itself.
  • 0

#5 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1589 posts
  • Version:GM8.1

Posted 28 April 2012 - 01:17 AM

If it was a depth problem, you would not see the background through the large gaps where alpha is 0 in the leaves.

Actually, alpha==0 causes the depth to not be recorded, so the background will be visible through alpha==0 areas.

I think your texture have the edges around the color of the leaves. It happens often when you grab textures of the web, the background of the texture is whitish and the leaf edges have a blend from green to white in the image itself.

But you are right about this. Color is interpolated linearly.

For example, while you might expect the pixel halfway between <1, 1> and <0, 0> (<color, alpha> pairs) on a 1 background to be 1, the <color, alpha> pair is interpolated to <0.5, 0.5>, then applied using the alpha formula: (1 - 0.5) * 1 + 0.5 * 0.5 for a final color of 0.75
  • 0

#6 Misu

Misu

    Awesometasticness!

  • GMC Member
  • 435 posts
  • Version:GM:Studio

Posted 28 April 2012 - 01:27 AM

1) The easiest and least complicated fix is to disable interpolation before drawing it, then re-enable it after.
2) Look into UV Mapping, either through Blender or a GM-made tool.

Hey, the number one actually fixed my problem thanks! However, I don't understand this "uv mapping". I'll see what might come with this. :thumbsup:

EDIT: I don't know how to uv map! Does anyone know a good tutorial? :confused:

Edited by MisuMen49, 28 April 2012 - 11:29 AM.

  • 0

#7 Misu

Misu

    Awesometasticness!

  • GMC Member
  • 435 posts
  • Version:GM:Studio

Posted 30 April 2012 - 11:09 AM

I STILL don't know how to uv map! Does anyone know a good tutorial? :confused:
  • 0

#8 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14386 posts
  • Version:GM:Studio

Posted 30 April 2012 - 03:43 PM

UV is like x,y, a coord on the texture, from 0,0 (upper left) to 1,1 lower right. it maps a 3d facet which is flat and made of 3 points to a triangular area on the texture. 0 to 1 is used because it allows switching between textures of different sizes 32x32 to 1024x1024

if you make a square with 2 triangles, you would set the uv of all the point to 0,0 1,0 0,1 first triangle and 1,1 0,1 1,0 for the second and that would make 2 triangle show a whole image.


repeating texture you will often see where the uv is a number larger than 1 or smaller than 0. going out of the 0,0 to 1,1 bounds is like wrapping back to 0,0. it also can be used to repeat the image, 0,0 10,0 0,10 first triangle and 10,10 0,10 10,0 would tile the image 10x10 times. texture_set_repeat(1) must be called for that to work.

My GMModelfix thread (see tools page) covers the topic a little
  • 0

#9 Misu

Misu

    Awesometasticness!

  • GMC Member
  • 435 posts
  • Version:GM:Studio

Posted 30 April 2012 - 06:59 PM

Ok so how do I know how to place my image correctly. I don't see the function or action in the program for this. I want an example on how uv mapping is done for game maker, that's all.
  • 0

#10 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14386 posts
  • Version:GM:Studio

Posted 30 April 2012 - 07:01 PM

>>I STILL don't know how to uv map! Does anyone know a good tutorial?

I missed that one...

UVMapper, google it

and I talk about it in GMModelfix, as said prior.
  • 0

#11 Gamebastard

Gamebastard

    GMC Member

  • New Member
  • 31 posts

Posted 01 May 2012 - 03:19 AM

Gamemaker uses the UV maps made in Blender when you export. UV mapping is actually really easy. essentiall, you want to split the view to the view of your model in edit mode and the image editor.

1: select all faces
2: on the 3d view window click "mesh" then unwrap.
3: you will get multiple choices. The best one for me personally is unwrap from view.
4: You can select any other parts of the model and unwrap from different angles or different unwrap types

Thats all there is to it basically.

To make that UV map into a texture i like to take a snapshot of the map and put it into gimp or photoshop. Remember, when you load the texture into gamemaker, mirror vertically. Blender makes the maps upside down for gamemaker. If you need any help please message me and I can give you a better example. good luck.

PS: the best way i've found for using blender models in gamemaker games is exporting as a .obj file and using this converter --> http://sandbox.yoyog...model-converter
  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users