Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / SET ALPHA MAPPING ON doesn't work on blend mapped objects.

Author
Message
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 31st Aug 2005 13:05 Edited at: 31st Aug 2005 13:08
Not only does the alpha mapping not seem to work on blen mapped objects, but using the command causes the blend mapped object to lose its transparency too. I've written this test code to demonstrate the problem:



If you rem out the 'set blend mapping on' line, though, then the alpha mapping works as expected. If anyone knows of any work arounds, it would be most useful!

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 10th Sep 2005 23:17 Edited at: 10th Sep 2005 23:17
Ric, here's a stab at it. The alpha mapping isn't working yet, but the transperancy sticks around. I was just playing with the numbers and the way things were ordered (which seems to make a difference with Direct X).




Open MMORPG: It's your game!
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 10th Sep 2005 23:39
Thanks Rii - almost forgot about this thread! I think I actually have a successful workaround to this now using a memblock function written by ..... hmmm, can't remeber. Can't remember where I put the function either. I'm getting old. I'll post the function and the credit here as soon as I find it!

Zealous
19
Years of Service
User Offline
Joined: 13th Sep 2004
Location: Colorado Springs
Posted: 11th Sep 2005 05:49
Hey im wrestling with another bug right now with alpha mapping instanced objects. it seems as soon as you set alpha mapping on a instanced object all transparency is lost, and there is no way to get it back (set shading off, set object transparency, nothing). Once you alpha map it, you are hosed.

Is there a fix for this too?

All you need is zeal
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 11th Sep 2005 13:29
@Zealous: Here's the function I'm now using for alphamapping, courtesy of Lost in Thought:



The value is out of one hundred. See if that solves the problem you're having.

And the function I'm using to blend two images is:



which is based on code by Math89, where p# is a value between 0 and 1 and determines the proportion of each image image that gets blended (ie 0.5 will blend half of each, 0.25 will blend a quarter of one and three quarters of the other) and threshold# is a value between 0 and 255 and determines the minimum colour value of the original image which is affected by blending (ie. a value of 20 will mean all colour values below 20 in the original image will remain unchanged, and all colour values above 20 will get blended with the new image)

Make sure blended images are of equal size. Works with the opacity function above.

Zealous
19
Years of Service
User Offline
Joined: 13th Sep 2004
Location: Colorado Springs
Posted: 12th Sep 2005 00:53
Nooooo I cant muck with the image, as I am working with instanced objects (they all share the same image, but need to alpha in and out individually).

Please tell me there is another way!

All you need is zeal
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 12th Sep 2005 01:42
When you say you lose all transparency - is it still transluscent or completely opaque? And what flag for transparency are you using?

Zealous
19
Years of Service
User Offline
Joined: 13th Sep 2004
Location: Colorado Springs
Posted: 12th Sep 2005 02:11
Im using flag 2. When I say it loses all transparency, I mean it goes back to a solid image (where there once was alpha, there is now solid white). Its like a instanced objects cant have transpaerent spots on its image, AND be alpha mapped at the same time.

All you need is zeal
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 12th Sep 2005 02:52
What if you set ghosting on as well? I once used transparency (flag 5), ghost (5) and alpha mapping on all together to get the right effect.

Zealous
19
Years of Service
User Offline
Joined: 13th Sep 2004
Location: Colorado Springs
Posted: 12th Sep 2005 03:55
oh I can alpha map a object with transparency flag 2, but not a instanced objects. Ill try ghosting when I get home but I have a feeling it wont work (even if it does, ghosting wont help, i need to fade it in from nothing to solid).

All you need is zeal
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 1st Oct 2005 22:40
The current code uses "set blend mapping on 1,2,5" and this sets blend mapping on for object 1 and uses cube mapping data for the texture coordinates ( specified by the parameter 2 ) and then last of all modulate2x is set with the parameter 5.

Try changing this so the UV coordinates are taken from the plane object. Use 0 for the 2nd parameter e.g. set blend mapping on 1, 0, 5. Now you can get to see alpha mapping working in conjunction with the blend mapping.
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 2nd Oct 2005 12:02
I'm confused - according to the help file, the second parameter is the image number. So setting blend mapping on with 1,0,5 presumably tries to blend with image 0, which doesn't exist - no? In any event, it still doesn't work for me - if you care to check:



However, reading around the forums a bit, I discover that there are actually 5 parameters now: object,stage,image,texturecoordmode,blendmode. I've tried using this format by putting various different numbers in, but as I can't find any information on what the various modes mean/do, I'm rather lost.

jrowe
21
Years of Service
User Offline
Joined: 12th Oct 2002
Location: Here
Posted: 2nd Oct 2005 12:27 Edited at: 2nd Oct 2005 12:51
Ric: An explanation of the new blendmapping parameters can be found in Jessticular's Helpfiles:

http://jessticular.dbspot.com/index.php?nav=dbhelp&command=149

Perhaps, If you find a workaround for the alpha issue you can post it there too?

EDIT: The 5.8 example pack is good as it gives examples of all the new commands, worth a download.

Tinnedhead Productions

For Fathers and Sons who enjoy wholy spirits.
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 2nd Oct 2005 12:39
Thanks for that Jrowe - I'll look into it.

Zealous
19
Years of Service
User Offline
Joined: 13th Sep 2004
Location: Colorado Springs
Posted: 9th Oct 2005 09:04 Edited at: 9th Oct 2005 10:30
Hmm something still isnt right. Check out my source. It seems if you apply blendmapping to any stage but 0, alpha mapping flips out and stops working.

In my terrain, I use uv stage 0 for a base color map, and uv stage 1 for a detail map. And because of that, alpha mapping wont work. Why should it matter how many times you blend, or to what stages? Why does alpha mapping care?

See source for a example

All you need is zeal

Attachments

Login to view attachments
Zealous
19
Years of Service
User Offline
Joined: 13th Sep 2004
Location: Colorado Springs
Posted: 10th Oct 2005 00:47
Please unreject this for bug week or explain why alpha mapping cares if you use blend mapping on stages other than 0

All you need is zeal
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 10th Oct 2005 12:41
Zealous - the alpha factor is always dealt with as the last texture stage. To get your code working set a blend mapping mode for stage 2 - set blend mapping on 1,2,0,10,2. Your alpha is now applied last and things look like they should.

Here is the modified code -

Zealous
19
Years of Service
User Offline
Joined: 13th Sep 2004
Location: Colorado Springs
Posted: 11th Oct 2005 00:38 Edited at: 11th Oct 2005 00:40
Well your code works, however, when I set the sync rate to 0, the object flickers in and out. Can anyone else confirm? ONLY when I set sync rate to 60 does it fade in liek it should...

Does it have something to do with the fact youre using a image 0?

*Edit Duh, ignore that. Dang I didnt think the thing would be running at light speed. Was just moving very fast ehe im teh newb

All you need is zeal

Login to post a reply

Server time is: 2024-04-19 18:33:11
Your offset time is: 2024-04-19 18:33:11