| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
| Alpha blending; Bad results | |
|---|---|
| Tweet Topic Started: May 11 2009, 05:11 PM (324 Views) | |
| hepolite | May 11 2009, 05:11 PM Post #1 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
I once heard Gandalf said "To my knowledge, U3D uses multiplicative alpha blending", and this is what I've encountered. My model uses a texture with the alpha channel, and so does the shadow of the model. When the alpha from the model is above the shadow (A flat model with alpha), I get nasty results, because of the multiplicative blending. Is there any way to prevent that from happening? Here's a picture of what's wrong: http://i39.tinypic.com/fk8aqa.jpg It's supposed to be a smooth transparency, not the sudden "jump" you can see there. The help-file doesn't really help me here... "When you use multi texturing the alpha component will always use a multiplicative texture operation." So is there any way to avoid this problem instead of removing the alpha from the model? |
![]() |
|
| Gandalf20000 | May 13 2009, 02:12 AM Post #2 |
![]()
Geek
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Is the shadow on a slanted surface? If so, your problem is not so much that it's the blending, but it's clipping against the surface. |
![]() |
|
| hepolite | May 13 2009, 08:30 AM Post #3 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
It's not the shadow that's the problem. When the alphaed area of my model is drawn over something else with alpha, the results are pretty bad. The alphaed area of the model becomes almost transparent when the river is in the background, even trees which have some alpha makes the alphaed area on the model go almost invisible. |
![]() |
|
| Dr. Best | May 13 2009, 12:26 PM Post #4 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
What you've got there is a very basic and common problem of 3D pipelines. You can only get correct alpha blending for all objects, if they are rendered in back to front order, but sorting them like this takes a lot of time and sometimes it is actually impossible, without splitting up meshes and triangles, which would be very expensive. For this reason Ultimate 3D 2.1 does not perform any back to front sorting, so this is why it yields these poor results (Ultimate 3D 3.0 sorts based on the octree ). If transparent things cover solid things, it is no problem, but if transparent things are covered by transparent things, there may be wrong results dependent on the order it is rendered in. There are only very few things you can do about this. The best way is as follows: Use SwitchAlphaBlending(...) to disable alpha blending for particular objects to reach that transparent things will not cover transparent things most of the time.
|
![]() |
|
| hepolite | May 13 2009, 06:05 PM Post #5 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
I find it quite hard to think of a way to do that for every object in the game that uses alpha (And that's a lot), so I'll choose the second best: I'll just remove the easy-to-spot alpha on the model. The result are about the same, so it doesn't really do much damage. |
![]() |
|
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |





![]](http://z1.ifrm.com/static/1/pip_r.png)




). If transparent things cover solid things, it is no problem, but if transparent things are covered by transparent things, there may be wrong results dependent on the order it is rendered in. There are only very few things you can do about this. The best way is as follows: Use SwitchAlphaBlending(...) to disable alpha blending for particular objects to reach that transparent things will not cover transparent things most of the time.
10:18 AM Jul 11