Advertisement

Check out my 3D tile engine please

Started by October 24, 2000 05:15 PM
85 comments, last by Possibility 24 years, 1 month ago
quote: Original post by Possibility

I tried putting all 3 of my tile images onto a single texture, and then just using the portion of that texture i need for that tile, but there is a problem with that, and that is blurrying you get at the transition like from 1 tile image to the next on your single texture image.

For example if in your texture you have the water tile image next to the grassland tile image, then the green and blue become blurred with each other, so when you draw your grassland tile the edge of it will be slightly blue for the edge of the texture that was next to the water.

Possibility


You got your Texture coords wrong there. A u or v of 0 is the same as 1 i.e. BETWEEN first and last texel. You have to use 0.5/texturesize for the very left pixel and (texturesize-0.5)/texturesize for the last one... Someday, I'll do a short tutorial on that I think... people get it wrong all the time...

- JQ, PWC Software
"programming is all about wasting time" -me

Edited by - JonnyQuest on October 28, 2000 8:42:19 AM
~phil
I know, and that is exactly what I did.

Take for example, you have a blue 32x32 texture, and a red 32x32 texture, and so instead of having them in seperate textures you combine them to one 64x32 pixel image, with the blue on the left and the red one on the right.

So when you need the blue texture, the u value goes from 0.0 to 0.5 and for the red texture, the u value goes from 0.5 to 1.0, the v value for both of them are 0.0 and 1.0.

The problem now, is that when you draw these, the right edge of the blue texture will be purple, and the left edge of the red texture will also be purple, because of that smearing of colors that always occurs (blue + red = purple).

That is what I was refering too before.

Possibility
Advertisement
The new verion still doesnt work on my comp.

=(
PII 450
ATI RAGE LT PRO with 4MB RAM
128MB RAM
=(

Might desktop resolution or color matter somehow?

I seriously doubt it, but...hey...anythings possible with DX7.
steady 60-70 fps, Athlon 800 GeForce256

-e
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein
quote: Original post by Possibility

I know, and that is exactly what I did.

Take for example, you have a blue 32x32 texture, and a red 32x32 texture, and so instead of having them in seperate textures you combine them to one 64x32 pixel image, with the blue on the left and the red one on the right.

So when you need the blue texture, the u value goes from 0.0 to 0.5 and for the red texture, the u value goes from 0.5 to 1.0, the v value for both of them are 0.0 and 1.0.

The problem now, is that when you draw these, the right edge of the blue texture will be purple, and the left edge of the red texture will also be purple, because of that smearing of colors that always occurs (blue + red = purple).

That is what I was refering too before.

Possibility


Well, in short, a u or v of zero means BETWEEN the very first and the very last texels. You have to set it to the center, though. To get the first texel you have to use u=0.5/Texturewidth and v=0.5/Textureheight
Analogous, for the very last pixel it''s u=(Texturewidth-0.5)/Texturewidth and v=(Textureheight-0.5)/Textureheight

I plan to make a tutorial on texture coordinates. That is, if enough people are interested - see This thread

- JQ, PWC Software
"programming is all about wasting time" -me
~phil
I get a steady 60 fps solid.
PIII 500MHz
Diamond Viper 770
128 Megs of Ram

It looked very good

-------------------"Pointer?" -Anonymous-=Xelius=-
Advertisement

I get a steady 10 fps solid.
PII 400MHz
Riva TNT2
64 Megs of Ram

It looked very not-so-good


(strcpy from Xelius)


/* * Hello World!! */
On my PIII 667, 128MB, Geforce2 counter of FPS is 100 or 999 i cant see, U must do timedemo or somthink )))

Ed3i
strcpy cause my post was just so badass and original

-------------------"Pointer?" -Anonymous-=Xelius=-
1 is neither a multiple nor a power of 2.

Tell me what integer to multiply by 2 to get 1 and I''ll bow down and praise you.

-----------------------------

A wise man once said "A person with half a clue is more dangerous than a person with or without one."

The Micro$haft BSOD T-Shirt
-----------------------------A wise man once said "A person with half a clue is more dangerous than a person with or without one."The Micro$haft BSOD T-Shirt

This topic is closed to new replies.

Advertisement