| View previous topic :: View next topic |
| Author |
Message |
Oby1Chick
Joined: 13 Feb 2010 Posts: 24
|
Posted: Sat Feb 13, 2010 4:15 am Post subject: Alpha texture on a 3D object with PSPGU library |
|
|
Hello guys,
Well, I was wondering (and I think this forum is the best place to ask such a question) if it was possible to apply a texture with transparency on an OBJ 3D file loaded with the PSPGU library.
Let's say it it is just a cube.I know how to print texture on it.But if the texture (a PNG) is totally transparent, will I be able to see thru the cube ? Or it won't work properly and I need to do something before - Or it is impossible ?
Thanks a lot for clarify this problem for me,
Oby. |
|
| Back to top |
|
 |
anmabagima
Joined: 01 Oct 2009 Posts: 96
|
Posted: Sun Feb 14, 2010 6:29 am Post subject: |
|
|
Hi,
yes - if the texture is fully transparent you can view through. But there are some contraint. You really need to pass the far awy object - the once beyond the cube first, and than the cube...
If you wont to make the cube transparent like glass you should first render the backfaces with eg. sceGuFrontFace(GU_CW) and than the fron faces with sceGuFronface(GU_CW).
Regards |
|
| Back to top |
|
 |
a_noob
Joined: 17 Sep 2006 Posts: 97 Location: _start: jr 0xDEADBEEF
|
Posted: Sun Feb 14, 2010 10:46 am Post subject: |
|
|
| anmabagima wrote: | Hi,
yes - if the texture is fully transparent you can view through. But there are some contraint. You really need to pass the far awy object - the once beyond the cube first, and than the cube...
If you wont to make the cube transparent like glass you should first render the backfaces with eg. sceGuFrontFace(GU_CW) and than the fron faces with sceGuFronface(GU_CW).
Regards |
Nah, I would save the 2 pass technique for a single pass and just disable backface culling for objects with transparent textures.And, Yes for transparency you do need to do z ordering as in, render furthest items first. However this is slightly slower since data needs to be overwritten in the z buffer. So I would make some hybrid organization code that shoots rays through our current object so that it only renders objects behind it before it, and then the rest in the opposite order. _________________
| Code: | .øOº'ºOø.
'ºOo.oOº' |
|
|
| Back to top |
|
 |
Oby1Chick
Joined: 13 Feb 2010 Posts: 24
|
Posted: Sun Feb 14, 2010 7:24 pm Post subject: |
|
|
Thanks a lot for your replies guys !
Well, in fact I am making a 3D racing game in C/C++ and I've finished to model all the 3D objects.But I have some low-polygon trees that I created on this principle : Its just a plane with a tree texture which has a transparent background.
In my game, I use the trees to make the landscape nicer.Behind the trees, the only object there can be is the skybox because they are on the top of a mountain.
So I will render the skybox and then, the trees.
Thanks again for your help. |
|
| Back to top |
|
 |
|