Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#1 29-Feb-2012 09:29:59

sky14
Member
From: Poland
Registered: 4-Dec-2011
Posts: 8

Alpha channel problem

Hi,
I have a small problem with the alpha channel.
So, I made the texture with the alpha channel(I wanna get transparency), but when I'm importing the model with this texture to the editor, there, where should be transparency is a black colour instead of it.
Is there some solution?

Thanks in advance

Offline

#2 29-Feb-2012 09:35:20

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: Alpha channel problem

Hello,

You have to create a material that manage alpha too.
If you use 3ds max to create your objects, just set a transparency on the material (with Easy Ogre Exporter).

if you want to modify manually the material script see : http://www.ogre3d.org/docs/manual/manual_14.html

Offline

#3 29-Feb-2012 09:45:49

Nodrev
Scol Language & OS3D developer
From: Nantes, France
Registered: 29-Dec-2009
Posts: 197

Re: Alpha channel problem

For transparent objects, the related material parameters are "depth_check"/"depth_write": http://www.ogre3d.org/docs/manual/manual_16.html#SEC49

Offline

#4 29-Feb-2012 09:52:51

sky14
Member
From: Poland
Registered: 4-Dec-2011
Posts: 8

Re: Alpha channel problem

Thanks for helpful replies.

Last edited by sky14 (29-Feb-2012 11:39:34)

Offline

#5 29-Feb-2012 16:11:09

sky14
Member
From: Poland
Registered: 4-Dec-2011
Posts: 8

Re: Alpha channel problem

Ok, I managed to make transparency but still I want to get a bit different effect.
I made a two images which will show what I mean.

First image showing effect which I have currently:
eff1.jpg

Second image showing effect which I would to get.
eff2.jpg
My question is, how to get such effect like on the second image?
BTW. I use the Fragmotion to exporting models and all changes in the material I must write manualy.

Offline

#6 29-Feb-2012 16:19:23

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: Alpha channel problem

try this in your pass :

                        ambient 0.447059 0.447059 0.447059 1
			diffuse 0.588 0.588 0.588 1
			specular 0.203922 0.203922 0.203922 1 10
			scene_blend src_alpha one_minus_dest_alpha
			alpha_rejection greater_equal 128
			cull_hardware none
			cull_software none

			texture_unit leavesTex
			{
				texture texture.png
				filtering linear linear linear
			}

Offline

#7 29-Feb-2012 16:20:51

Nodrev
Scol Language & OS3D developer
From: Nantes, France
Registered: 29-Dec-2009
Posts: 197

Re: Alpha channel problem

Ok, for a tree, use "alpha_rejection" on the pass (http://www.ogre3d.org/docs/manual/manual_16.html#SEC54). It takes a parameter between 0 and 128, which will be used for checking if the value in the alpha channel is upper or equal to it. If so it will show the colour on the rgb channels.
You can also use "alpha_to_coverage on" for better quality (smoothed edges between transparent/visible).
<edit>gasp arkeon got me again, bip bip</edit>

Last edited by Nodrev (29-Feb-2012 16:21:27)

Offline

#8 29-Feb-2012 16:59:17

sky14
Member
From: Poland
Registered: 4-Dec-2011
Posts: 8

Re: Alpha channel problem

Ok, I added alpha_rejection command to the material and now it works! Thanks for help!

Offline

#9 1-Mar-2012 00:44:53

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,543
Website

Re: Alpha channel problem

fwiw there are quite a few threads on the ogre3d.org forums about alpha materials....if you look for my username and 'alpha' there you should find some code

Offline

Board footer

Powered by FluxBB