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.

DarkBASIC Professional Discussion / Alpha fading a vertex...

Author
Message
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 3rd Mar 2004 00:19
I noticed that some people have been able to alpha fade a single vertex on a mesh, and I was wondering how they did it. The guy over at...

http://darkbasic.thegamecreators.com/?m=forum_view&t=25754&b=8

Didnt really explain how he did that particular part, but I know its possible. Can anyone help me out? There just arent any settings for alpha when you make a mesh via memblocks, so im out of ideas.

Thanks in advance

All you need is zeal
Preston C
22
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 3rd Mar 2004 00:53
Its quite possible. Its either through loading a model with vertex alpha already with load mesh and make an object from the mesh, or you can do it through memblocks.

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 3rd Mar 2004 01:45
Heh how tho? I made a model in max and set the alpha on a couple verts to 50%. When loaded into dbpro (after converting to .x of course), the model was solid as could be. Can you detail step by step how to make a simple object in max (like a cube), with a couple verts faded, then how youd load it into dbpro?

Also, you say you can acces vert alpha in memblocks? How?

All you need is zeal
Preston C
22
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 3rd Mar 2004 02:44
As for max, can't help you there. I can't afford it, and I'm no software pirate (I despise people that do pirate software). But I can supply something that could help. It isnt documented well, but there is a bit of an explanation at the top:



You may have to study up on the DBPro memblock mesh format a bit first though.

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 3rd Mar 2004 03:30
I already know how to make a mesh out of a memblock. The code you just posted doesnt describe how you control alpha for each individual vertex...

As for Max being too expensive, you can get a student/trial version pretty easy

All you need is zeal
Preston C
22
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 3rd Mar 2004 03:32
Yep, it shows how you control alpha for each vertex. You see where I fill in the vertex colors? The fourth value is vertex alpha. Thats how you control vertex alpha with memblocks

As for the trial for 3DS Max, can't make anything commercial with it, not worth my time.

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 3rd Mar 2004 03:44 Edited at: 3rd Mar 2004 03:49
Ahhhh i see, 4 bytes instead of one float. Got it thanks.

*edit* one more question. Is there anyway to determin what the float value would be after calculating R,G,B,Alpha? I need to know because the 'new' U6 command SetVertexDataDiffuse is set up to use a float, not 4 bytes. So how would I set a vertex color&alpha using a function like this...?

function SetVertexDataDiffuse(vertex as integer, color as dword )
call dll 1, "?SetVertexDataDiffuse@@YAXHK@Z", vertex, color
endfunction

All you need is zeal
AlecM
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 3rd Mar 2004 05:12
I didnt think darkbasic loaded vertex alpha.

Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 3rd Mar 2004 05:20
So in otherwords if i set alpha vertex in any modeling program, when its converted to dbo the alpha will be lost? That would explain why my models never worked. I guess as a temp solution I wouldnt mind setting the alpha manually via that function, or even making the whole damn thing from a memblock... But I need a way to set rgb color AND alpha in a single dword, rather than 4 bytes.

All you need is zeal
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 3rd Mar 2004 05:29
the current .x loader in DBPro doesn't load vertex colors/alphas.

the .dbo format (as well as the .x format technically) support vertex colors/alpha, but the DBPro .X loader ignores them now.

however a .dbo file with vertex colors/alpha loads fine. the problem is making the .dbo file in the first place.

RobK's DBO convertor doesn't work because it is built using dbpro, and therefore the vertex colors of the source .x file are ignored.

currently the only program I know that can make a .dbo file is Gile[s], a lightmapper. if you could send me a .x file with vertex alphas, I'll try and load it in Gile[s], maybe its .x loader can handle vertex colors. if so, I should be able to export the model as a .dbo with all that intact.

would be worth a try.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 3rd Mar 2004 05:38 Edited at: 3rd Mar 2004 05:38
I appreciate the offer Walaber but I cant expect you to convert all my models for me. I really think things will be fine if I can just figure out what how to convert a r,g,b,a to a single dword, and back again. That way I could load my model, alpha fade whatever vertices I wanted to using "SetVertexDataDiffuse", then save the whole thing as a mesh. Then I could reload it with vert alpha intact anytime I needed to use the model.

A half assed solution I know, but I really only need faded vertices for simple plains, particle effects, water falls, ect... So not THAT hard to pick and fade each individual vertex inside dbpro.

All you need is zeal
Aslyum
21
Years of Service
User Offline
Joined: 21st Jan 2004
Location:
Posted: 3rd Mar 2004 05:38
The .x loader in DBP *does* support vertex. You just need an .X exporter that exports the RGBA for vert color data - that's all.

- AsylumHunter
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 3rd Mar 2004 05:40
Ahh hmm interesting... im using 'conv3ds' from 'May 3,1996'. Can you point me to a .x converter that would support what im trying to do?

All you need is zeal
Aslyum
21
Years of Service
User Offline
Joined: 21st Jan 2004
Location:
Posted: 3rd Mar 2004 05:42
Ah crap - no problem zeal, no edit on these forums yet.. I missed a word or 2...

The .x loader in DBP *does* support vertex Alpha. You just need a .X exporter that exports the RGBA for vert color data - that's all. Panda exporter for Max 6 supports this.

here's the link:
http://www.andytather.co.uk/Panda/directxmax6.htm

- AsylumHunter
http://www.LeadArtist.com
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 3rd Mar 2004 05:48 Edited at: 3rd Mar 2004 06:02
Well im using max 5, so I dont think that plugin will work (gonna try now). But yeah, there is no way to export to .x, I have to go 3ds, then convert to .x. Is it possible my 3ds-.x converter is just out of date?

BTW, there IS a way to edit posts on this forum. Right below your name and picture on the left side. Took me like 4 months to notice it too heh.

*edit* yup panda plugin is no good in max 5. nuts
*edit again* but I found another 'panda' exporter for earlier versions. Trying it now...

All you need is zeal
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 3rd Mar 2004 06:10 Edited at: 3rd Mar 2004 06:14
Hmm well the plugin works, lets me export to .x, but something still isnt working...

So I make a cube in max 5, apply a edit mesh modifier, grab the top vetices and set their alpha to 0%, the vertices on the bottom I leave at 100%. I export the selected cube as .x, load it into dbpro, and I get a solid cube, no alpha fading. What am I doing wrong? Does this pre max 6 panda exporter not support vertex alpha? That would be dandy, dont tell me I need to upgrade to max 6 already...

Yup well thats just great. Noticed only the beta version of that panda thing supported vertex alpha, and the beta version is ONLY for max 6...

http://www.pandasoft.demon.co.uk/directxmax4.htm

Guess ill start looking around for a pre max 6 vertex alpha direct x exporter...

All you need is zeal
AlecM
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 3rd Mar 2004 08:09
Asylum: Im pretty sure darkbasic pro doesnt load vertex colors. I dont know about vertex alpha though. although, The version I have does

Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 3rd Mar 2004 10:03
Vertex alpha is a component of the vertex colour information (there are four bytes, one each for Red,Green, Blue and Alpha), so you'll need to ask Froggermon for the hacked DLL.

You have to enable object transparency using set object transparency objectId,1 as well.

You can change vertex alpha using memblocks, but atm. its not very fast if you need to do it often.


BlueGUI-Windows UI Plugin
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 3rd Mar 2004 10:33
IIRC Asylum Hunter said that loading a .X file as a mesh then creating an object from it allows vertex colours including alpha.


Van-B


The nature of Monkey was irrepressible!.
monkee
22
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 3rd Mar 2004 13:58


Here you go, vertex coloured with alpha applied.(via froggermon,thnx )
I dont agree with having to hard code the values, if x files retain the information then you should just be able to load the models with colour and alpha values. Same goes for having multiple uv sets. If DBpro had 100 percent x file compatability it would make life much easyer.
Messing around with all this meshblock mallarchy is getting in the way of artist input. Dont get me wrong though, its a good thing you can.
Monkee
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 3rd Mar 2004 22:31 Edited at: 3rd Mar 2004 22:57
Here I go? Think you forgot to attach something monkee

And rob, I havent been setting transparency on, ill go try it now...

*edit* well, some good news. I figured out how to convert the 4 bytes to a dword, heres what I did... First I made a 4 byte memblock, and filled it with R,G,B and Alpha. Then I read it back as a dword from position 0, simple enough. With this dword im able to use the setvertexdiffuse function. Combined with robs suggestion to set object transparency on, I WAS able to get a object with alpha faded vertices.

However, the model I made in max did NOT work even when I set transparency on, leading me to believe that the vertex alpha values arent being exported with my crappy panda .x exporter. Sigh...

All you need is zeal
Mussi
22
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 3rd Mar 2004 23:03
could you show what this vertex alpha fading does?



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 4th Mar 2004 00:49
Just imagine a square plain, made up of two triangles. Now imagine the left side of the plain is solid, while the right side of the plain is invisible/transparent. Thus, you get a nice blended transition from solid, to invisible on your model. Its really important for particle effects, ect. By alpha fading parts of a plain, you can have textures that seem to fade away, rather than sharp contrasting edges where the texture just stops.

All you need is zeal
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 4th Mar 2004 01:50
Monkee did you really find a way to load a .x and keep alpha values? Im thinking if I export my model as .3ds, then convert to .x using conv3ds it should still keep the alpha values right? How could I find out?

All you need is zeal
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 4th Mar 2004 02:17
yoo could load the object, then convert it to a memblock, and then examine the data and see what's going on with the vertex colors...

I wasn't going to convert all your models for you, I just wanted to see if it would work

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 4th Mar 2004 02:24
Well im sure i can get what I want done now that I learned how to convert r,g,b,a to a dword, but as Monkee said "Messing around with all this meshblock mallarchy is getting in the way of artist input". The point is, I shouldnt have to mess around with this stuff inside db, its a real half assed solution. I should be able to load the model straight in from max, and have it recognize the alpha settings.

All you need is zeal
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 4th Mar 2004 05:19
Does anyone know exactly what rob meant when he said "so you'll need to ask Froggermon for the hacked DLL"? Does anyone besides Froggermon have this 'hacked' dll? I tryed sending him a email, but his address is dead. Couldnt find anything via search either. Will this really allow me to import .x models with vertex color/alpha settings?

All you need is zeal
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 4th Mar 2004 07:42 Edited at: 4th Mar 2004 07:43
Quote: "Here I go? Think you forgot to attach something monkee"


He posted an image in his post, it doesn't show up by default so you need to right click and paste the url into the browser. Or just copy this one into the address bar. Can't even hyper-link it.

http://www.roystonstew.netfirms.com/images/VertexAlpha.jpg


"Computers are useless they can only give you answers."
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 4th Mar 2004 07:49
Heh so monkee was just teasing me. Thats a lovely screen, but HOW did you load it?

And by the way, I think I may need another .3ds to .x converter if anyone can point me to one. The one im using now (conv3ds) must be very old, because it doesnt carry vertex color or alpha even when loaded as a mesh. However, when I save a object as .x directly from max (using that panda exporter), then load the .x as a mesh, the colors show up, but not the alpha. Sigh... what the hell

All you need is zeal
AlecM
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 4th Mar 2004 10:37
Zeal, mail me. [email protected]

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th Mar 2004 10:37
Erm, has anyone tried loading the vertice coloured .X file as a mesh then converting to an object?


Van-B


The nature of Monkey was irrepressible!.
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 4th Mar 2004 10:49
Frog - Hmm thats the same address i tryed before. My mail server must be screwed up. You can try sending to me at [email protected], I seem to be recieving ok, just cant send...

Van - Yeah I tryed that, and like I said I WAS able to load a cube with colored vertices, BUT it had no alpha. I cant tell if its just my crappy max to .x exporter thats not exporting alpha data, or dbpro is just ignoring the alpha channel when the thing is loaded. Who knows...

All you need is zeal
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th Mar 2004 12:08
Ahh, but!...

Quote: "You have to enable object transparency using set object transparency objectId,1 as well."


Did you do that as well? - Asylum Hunter managed with his uber-cool terrains, so it must be possible.


Van-B


The nature of Monkey was irrepressible!.
Aslyum
21
Years of Service
User Offline
Joined: 21st Jan 2004
Location:
Posted: 4th Mar 2004 18:30 Edited at: 4th Mar 2004 18:30
The easiest way to debug your exported data is to export your .x in Ascii format and then load this Ascii file into WordPad and see if it contains the correct vert color information.

- AsylumHunter
http://www.LeadArtist.com
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 4th Mar 2004 23:05
Van - yeah im setting object transparency on

Asylum - Is there any other way to convert a .x to ascii outside of max? My panda .x exporter only seems to export. I cant import a .x back into max in order to convert it to ascii...

However from reading the info on this panda exporter, I DONT think its exporting alpha. They made it clear that vertex alpha WAS included in the beta version for max 6, so that makes you think its NOT in earlier versions.

If I could find a recent program that converts .3ds to .x AND maintains vertex color&alpha, I think that would solve all my problems. But conv3ds is the only one I know of, and ive yet to find a version that claims it converts vertex color.

Zeal is stuck yet again

All you need is zeal
Aslyum
21
Years of Service
User Offline
Joined: 21st Jan 2004
Location:
Posted: 5th Mar 2004 05:33
Hey Zeal,

You'll need Max 6 for Panda alpha to work, however, in the meantime all you have to do is export your data twice and merge the data.

1.Export a mesh with your vert colors
2.Export the same mesh but this time replace your vert colors with with vert colors that will represent your alpha data

Then merge both sets of vert colors in dbp. Thats how I did the landscape.

Hope this helps

- AsylunHunter
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 5th Mar 2004 09:41
I suppose it wouldnt be two hard to make two models one with color one with alpha, but how do I "merge" the two meshes inside dbpro? Sounds like it would require a somewhat complex sub program...

All you need is zeal
monkee
22
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 5th Mar 2004 14:55
All i did was export from max6 using the panda exporter.
You dont need to export it twice, the x file retains the vertex colours and alpha information.
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 5th Mar 2004 23:25
Argg heh I know that but I dont have max 6...

So Aslyum how do I merge the two models in dbpro? Like I said, sounds like it would require a somewhat complex program involving breaking the models down to memblocks, then making a new memblock (god knows how youd break the 4 byte dword back down into color again tho... or can you just add both rgb and alpha dwords together?).

Maybe more trouble than its worth. I might just pick and chose each individual vertex in dbpro and alpha fade them using set vertex diffuse. However id still like to know how you 'merge' two meshes, maybe its easier.

All you need is zeal

Login to post a reply

Server time is: 2025-05-27 22:11:47
Your offset time is: 2025-05-27 22:11:47