Candy World Models - Need help for blending

Community Forums/General Help/Candy World Models - Need help for blending

Xilvan(Posted 2009) [#1]
I'm presently working on various effects in Candy World : Heart of Heaven Tome III

The game itself is developing very easily, but I still need help for blending methods...

My model is a more close to reality Candy made by me and I want to make hair on her tail simply by making alpha brush.


Click on image to enlarge

My textures
Diffuse texture


Alpha texture(Dark = Transparent : Lite = Solid)



D4NM4N(Posted 2009) [#2]
The images are jpeg.

You cannot use jpeg for alpha or mask because of the jpg-encoding (it scrambles the color values so you cannot use a mask color either) and the fact it is only 24 bit (ie no alpha channel)
Download GIMP or use photoshop, make an alpha layer (in PS, erase background layer, in gimp layer>transp>add alphachannel) and erase any part of the image you want alphad (you should see a checker pattern appearing) then save as PNG(prefered) or TGA but DO NOT use JPG. JPG is only any good for photographic -solid- textures like grass, brick etc.

As long as you use b3d's 32bit video mode you should get alpha, otherwise you must use a maskcolor. (dont forget to set the texture flags to 11(i think it is 1+2+8, color+alpha+mip, but you might want to check that, its been a while since i used b3d.)


D4NM4N(Posted 2009) [#3]
I was bored at work so thought i would have a quick go

Try this with Entity? or could be textureflags to 11 & graphics3d(x,y,w,32) (you only need 1 image).




Xilvan(Posted 2009) [#4]
Hello there,

I've tried to render the new tail in the game but it didnt work very well...

So I opted to anoter way to make the tail...

Candy3 = LoadTexture("Candy4.bmp",4)

It gives a mask according to the texture.

It dont give the wanted effect, but it looks awesome...


D4NM4N(Posted 2009) [#5]
Hi sorry i just remembered,

Add the line:
TextureFilter (".png",11)

-Or-

use:
LoadTexture ("candy.png",11)

or use 3 rather than 11 if you want it non-mipmapped (sharper textures but slower and nasty at a distance)
It has to be the PNG i made for you above, not a BMP never use BMP for anything, it is a horrible uncompressed format that sucks footballs through a hose.

Also, did you enable the alpha like i said in 32bit video mode? because it works ok here when i texture a simple cube with it. If it doesnt work (ie have a feathery edge) then there is a problem with how you load/appy it, or there is internal geometry(faces) in your mesh screwing it up.

Masks are one way but they look terrible. The only advantage of masks that i can see is that it works on 16 bit color (other than a slightly less performance hit on REALLY archaic hardware).

I would push to get the alpha working you will get nice dithered edges.

Get it working and i guarantee it will look 100 times better than a mask. ;)


Xilvan(Posted 2009) [#6]
Look the model doest show very well


Maybe its because my Laptop has a intel GMA 965


D4NM4N(Posted 2009) [#7]
I think you might have some bad geometry there. Delete any internal faces and ensure all the normals are facing outwards.

Its either that, or you have other parts of the mesh using the transparent part of the UV map (remember it was a white area before so move those UVs onto another part of the image.


Oddball(Posted 2009) [#8]
It looks like alpha sorting issues. Display the model using mask blend instead of alpha.


D4NM4N(Posted 2009) [#9]
Lol, Thats exactly what i have been trying to tell him not to do. Masks look crap.

There should be no alpha sorting issues here, unless there is something very wrong somewhere else, perhaps the terrain is texturesplatted and is interfering with it, or the dog is more than one mesh with odd axis positions.

I still think the most likely issue is that he has his UV assignment wrongly positioned (ie the transparent bits you see in the screenshot on the back legs are mapped to the -now- transparent area and should be moved to another part of the texture that is solid and white). If it was a real z sorting issue then the terrain would show through the whole dog, not just the odd triangle.


_Skully(Posted 2009) [#10]
UpdateNormals...


Xilvan(Posted 2009) [#11]
I've tried for the tail but I got no success...

Updatenormals simply dont be the solution for making the tail.

But something very cool happened with all the icons of the foreground :
They have now smooth edges...

Today I'll work hard on the making of Candy World : Heart of Heaven Tome III


N(Posted 2009) [#12]
An alternative is to go for a zombie dog look, so that way you can make everything thin and bony and not have to worry about using alpha. E.g.,

(Disclaimer: I do not know dog anatomy [but neither does Xylvan, so it's all good])


Who was John Galt?(Posted 2009) [#13]
That's a brilliant bit of artwork, Nilium! Any chance of a render of it on the model.


D4NM4N(Posted 2009) [#14]
COOL!


Ross C(Posted 2009) [#15]
Actually masking works well if you use the .dds texture format, it gives i nice clean, slightly blended egde. You might wanna resize your texture to square numbers too. It's currently 800 x 400.


Gabriel(Posted 2009) [#16]
Actually masking works well if you use the .dds texture format, it gives i nice clean, slightly blended egde.

Are you sure that's what's happening? You can't have blended edges with masking unless you have "alpha-to-coverage" and I'm almost certain that wasn't introduced until DX9. On the other hand, DDS textures are the internal format that DirectX uses, so it can make assumptions about them. One such assumption is that DDS textures with an alpha channel are automatically loaded as alpha-enabled textures. So it sounds as though you're actually getting an alpha'ed texture, not a masked texture, and DX is just detecting the alpha channel and loading it automatically.


Ross C(Posted 2009) [#17]
Hmmm, i'm not sure, but when using the mask mode for the .dds texture, it doesn't suffer from the alpha sorting problems. It doesn't give you proper alpha, but it's the best texture format in blitz to use for masking. I hope jfk comes along, with a proper explanation. I have some code to demonstrate the point, but it'll be anothe rweek before i get my own internet access.

Apologies if my last post suggested the mask mode could use alpha, like the alpha mode :)

As a side note though, regarding the alpha channel. I've found (dunno if it's blitz specific) that if your alpha value is 127 or less, then the pixel/texel is invisible, and over 127 then the pixel is opaque. For the mask texture mode that is.


Kryzon(Posted 2009) [#18]

make an alpha layer (in PS, erase background layer)


That actually won't add an Alpha channel to your image (I thought that too at first), although the real method is just as easy.

You need to do this:
http://blitzbasic.com/Community/posts.php?topic=82448#930026


D4NM4N(Posted 2009) [#19]
Photoshop CS3 does. It must do because i do that all the time and my exported pngs have an alpha channel.


Xilvan(Posted 2009) [#20]
Beside the making of a hairy tail for Candy and Toopy I'm announcing a new playing mode in Candy World III : Solo Cooperative Mode

Two dog or Two cat will be playing the game... One will be callen the "The One" and the other will be callen "the Deuse"...

The One
Is fully controlled by the player and can we switched to another player.

The Deuse
Is a fully Xilvan Design Artificial Intelligence algorythm for helping the player beating the ennemies and collecting bones...
Actually the deuse cant collect bonus... But soon it will be possible.

The Deuse Can actually:
-Follow Candy or Toopy
-Fly with the One in the sky
-Battle ennemies

I programmed the AI of the second dog or cat in 3 days (It was long and very heavy) I was about to make a little dog grabbing the freesbies but I prefered making a fully Spyro like game. Sure it will look like Spyro, but the characters, items and challenges will be different.


GaryV(Posted 2009) [#21]
"the Deuse"


As in "dropping a deuce"?

The Deuse Can actually:
-Follow Candy or Toopy
-Fly with the One in the sky


Deuce with AI would be awesome. I especially like the idea of flying deuce. This brings a whole new aspect to the game and is quite unique.


Xilvan(Posted 2009) [#22]
A deuse mean a second player. Much like a companion that help you finish the game on your way.

The Legend of Spyro : Dawn of the Dragon actually have a good and nicely made coop mode. There can be a second player.

I'll work hard to make it possible in Candy World III

I will add a bonus collecting fonction to the little helper, hoping it will please everybody... Helpers are invincible.


xlsior(Posted 2009) [#23]
A deuse mean a second player.


Not in English...

Like Gary alludes to above, it sounds inappropriate in English, especially for a childrens game which appears to be what you're going for...


Xilvan(Posted 2009) [#24]
Deuse in my program is the name I use to name the second player...

Deuse is a kind of abreviation for Deuxieme, Second in english

Unfortunatly, I cant change that name since I tried to change it to "Deux" that means "two". I changed it once and I got all kind of bugs.


xlsior(Posted 2009) [#25]
I understand the origin of why you picked it (derived of the French word for two, etc.), but you really, really should consider what these things sound like in English.

It's horribly close to 'deuce' -- which according to urbandictionary.com is slang for:
deuce
- To shit; (noun) shit; (past tense) shitted or shat

and:

- A Word used in place of a swear word
- Word used in place of the word devil often as in a mild swear or oath.



Again, all of those are a pretty poor choice for a game aimed at kids...


Xilvan(Posted 2009) [#26]
I will name it "Helper" in english and "Aidant" in french


N(Posted 2009) [#27]
So could you make a version with a zombie dog and post that?

Also...
Unfortunatly, I cant change that name since I tried to change it to "Deux" that means "two". I changed it once and I got all kind of bugs.
This says an awful lot about your code...


Xilvan(Posted 2009) [#28]
I need the full texture of the zombie dog...

Cause some part are missing in your image.