Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: RandomTiger on September 29, 2002, 07:15:37 am
-
Um.. could do with some help guys.
Current state:
Ships still rendered blue
Some textures not displaying (HUD, smoke, explosions, font)
Still cheating with TGA's
Rnedering order incorrect for non textured polys
Heres what it actually looks like.
(http://www.ijbrooks.demon.co.uk/tom/blue.jpg)
Daveb if you are out there:
Any ideas why all 3D stuff is rendered a shade of blue?
-
Hey...I think thats awesome progress :) Keep it up!
-
Yeh, good progress... and I'd help you if I could. :(
-
It looks like to me (amateur programmer that I am) that for the hud you're displaying the alpha channel and the image area, but not the actual teture.
-
First of all I'm no programmer, but:
It looks like you are going to have to set the transparent color as green.
-
Umm I dont mean to be rude but I posted the pic to give people an idea of the state of the upgrade, not to get a visual analysis.
I need help with the code. Its easy to point out the problems, its why they are happening thats the hard part.
The green around the planet is simply because I've not managed to get V's pcx loading code working yet. However the reason the HUD and other textures arent displaying is a total mystery.
-
*looks at screenie*
Oh man I gotta... *barf* :p
-
Okay, well like I said I am no coder. I have no suggestions.
*barf* It is looking pretty good though. So far.
-
Im not sure I like all this *barf*ing. That means vomit in the UK.
Whatever it is Im not happy with it derailing my thread.
-
Yeah well, vomit, barf, puke, hurl, upchuck, they all mean the same thing. What progress have you made? All I can see is blue graphics and a bad HUD. You should work with the SCP people. They could help you. Doing something like this is pretty hard by yourself.
-
:mad: :mad: :mad: :mad: :mad:
Well, you have just showed your total ignorance.
I have made a *huge* amount of progress, most of freespace 2 is working in D3D8 in less than a month worth of work.
I *am* working with the source code project. This code *is* in cvs avaliable to all.
:mad: :mad: :mad: :mad: :mad:
-
I stand corrected. I was just wondering what's different. I mean, that pic doesn't show anything. What's different? Do you need new textures for it to look better? New sounds to make it sound better? I'm all for this, I just wanted to f_cking know what the hell is different!!!!!!!!!!
I do appreciate this very much, I know that DX8 can support many better things that will make fs1 better.
EDIT: Also the crack about different ways of saying barkfdoesn't have anything to do with the rest of the post. I should have put a smiley next to it.
-
arnt all the HUD an smoak, expolsion stuff in ANI format
you said you have been useing TGAs so maybe you shold focus on getting the old file loading code to work,
-
Also, on that note. You said you were using tga's?. Maybe some of the backgrounds and textures aren't redering worrectly because you aren't using .pcx files? Just a though. Maybe that's your blue texture problem. Try messing around with some color pallettes that the game uses, this could also help.
-
Originally posted by Bobboau
arnt all the HUD an smoak, expolsion stuff in ANI format
you said you have been useing TGAs so maybe you shold focus on getting the old file loading code to work,
Explosions are ani, I dont see why smoke and HUD would be.
Can anyone confirm?
Your totally right about TGA, thats what Im currently working on.
Its proving very difficult though.
-
I don't know about the smoke, but the HUD grapics are .ani. I know that for a fact.
-
yeah, hud is ani, so is the little particles for smoke when you shoot things...
-
HUD are all in ANI so are the particle effects and fireball textures, the fact that ani formatte is esentaly a buch of PCX files put together, and the fact that you can't get the PCX files to work indicates to me that you should focus on the loading routines for the 8 bit files
-
What about the font and shield effects, are they ani too?
-
Or, have fs2 run on tga files. On game loadup, it could convert the .pcx files its using to tga. Maybe you could try and make the game use a variety of formats, including .bmp .tif .jpg .pcx (Keep this one:D ) .tga and some other higher quality file types.
-
its most likely going to be TGA, PCX, and BMP (so i can make maps in MSPaint). And they are the most common
-
Yeah, that's what I thought, I was just naming some common files. One good thing about .tif files is that they aren't compressed at all. I'm not sure about .bmp files, or .tga files though. I think .tga aren't compressed.
-
sheilds are in ANI, and fonts are in a specal format I beleve is based on PCXs also
so what options are there for loading textures with DX8?
I hope there is more than just one way
I hope you have direct acess to the raw texture data
-
RandomTiger....I think most of us are posting here to show support for what you are doing. A few people may not understand that by changing over to DirectX8 what we can potentially do...but overall, although we cannot be of direct assistance...we can voice our support. I say great stuff and keep going for it.
HUD is definately all in ANI format although as Bobboau said, thats just a bunch of PCX files strung together with a collective pallet.
And just so the people who should see this thing...its stickified now!
Programmers....swoop in and assist :)
-
I create the texture, I lock the texture, I use V's code to fill the texture given (I believe) the correct shift values for the new DX8 chosen texture format then I unlock. Then I create all the mip map levels.
But something somewhere is going wrong. But looks like when I do get it sorted its going to fix an awful lot of things. :)
-
Tell me this, how much code did you have to change to get fs2 to accept DX8? I'm asking because if you changed some of the rendering codes, you might need to work with them a little.
EDIT: Other than the graphics problems, how is everything else working?
-
Hades, please stop posting to this thread or I'll have it locked and continue this debate in the dev list where I should have started it in the first place.
-
Patience ;)
A couple of folks are getting set up in CVS RT that might be able to help, grab me on ICQ.
BTW, I am back from my weekend trip, if you couldn't tell.
-
My last post. F_ck off and do that, I'm trying to help.
EDIT: If you don't want any help, then ask away somewhere less public. I assume that anybody posting in this forum that's asking for help wants of all things, HELP!! I am doing my best to help all I can, because I've heard some good things about this project, and I hoped it would succeed. I didn't mean to make anybody angry, and as you can see, I am not as computer literate as some of you. For some reason your total ignorance of the fact that I am trying to help you has made be even more angry than you even have a right to be at me. Go I'm not replying to this thread at all anymore, so you needn't close it. I'm not letting my temper at you get in the way of this MOD.
Also, I had no way of knowing that you were working in conjunction with the SCP team. Or that it was posted on CVS. I'll even scrible out all my other posts on this thread that tried to assist you. Except for my first one, which was, by the way, trying to be friendly. That is, if you want me to.:) Cheers:) Kudos if you succeed
:D :D :D :D
-
i know this may sound rather brutish, but we could step through the pcx loading code and use a hex editor to back up what the compiler says (watch variables, and such)
-
Given that Im not even getting distorted textures its obviously the image data is just not getting in there at all. Its probably something quite simple I that just cant see. Thats why I'd like someone else to take a look at it.
-
Might be an approach Phreak. I have not done that before though, so, if you have any ideas for a newbie on proceeding (or for RT's benefit, for that matter), please share (or email the dev list).
It's the DX8 branch in fs2_open if you want to have a look :)
-
Looks like it could all be down to this function:
int d3d_create_texture_sub(int bitmap_type, int texture_handle, ushort *data, int sx, int sy, int src_w, int src_h, int bmap_w, int bmap_h, int tex_w, int tex_h, tcache_slot_d3d *t, int reload, int fail_on_full)
Anyone who can tell me what this function does exactly and why (in DX5) can have a prize or something.
-
Think it might be your vid card, or some mods you have installed. I had that prob once with the Robotech mod, reinstalled it, and it worked fine.
-
Um... I think something odd is happing! :lol:
d3d_create_texture_sub is definately the key, took it out of a DX5 build and nothing displays. Been so wrapped up in loading forgot that I never sorted out this function.
-
let me look through it tomorrow. i should figure it out in like 20 minutes
-
I was just wondering if there would be any kind of performance gain due to switching over to DX8, I'm sure the GFX routines have been tweaked as DX has matured.
Not really important or relevant, just curious. :)
-
nt d3d_create_texture_sub(
int bitmap_type, int texture_handle,
ushort *data,
int sx, int sy,
int src_w, int src_h,
int bmap_w, int bmap_h,
int tex_w, int tex_h,
tcache_slot_d3d *t,
int reload, int fail_on_full)
I just did a google search on d3d_create_texture_sub, and the only hits I get are from the FS2 source itself, so that's not going to help (of course, you probably already did the same search yourself).
I remember getting a Windows 95 Game programming ebook on a Delphi 3 book's companion CD. I recovered it from a thick layer of dust, but it turns out to predate Direct3d, so it's not helping either.
As for my own programming skills, I'm afraid my experience with Direct3d is limited to the tutorial apps in the DX81 SDK, so I'm not sure I can help out. I'll check out the source all the same, and get back to you should I find something actually useful. At least you know I'm trying ;).
What about the Quake II source? Id made it available, and if I recall correctly, it's DirectX 5. Maybe you can find something in there?
-
PhReAk: Wow, you are very sure of yourself!
Maeglamor:
Good question. At first I thought there would be, not so sure anymore. Im not changing the architecture of the code just moving it to DX8.1. Doing too much at once will just lead to problems. Once it works perfectly in DX8.1 for everyone then theres a lot of stuff that can be done.
I guess we will just have to wait and see.
-
well the thing is obviusly some sort of, "take this bitmap and make it into something DX can use" thing, but you probly knew that already, I'm fairly sure this is not an actual DX function, but I only glanced at it and were it was used
-
RandomTiger,
d3d_create_texture_sub() is a utility function defined in GrD3DTexture.cpp, starting on line 495. As far as I can tell, it's essentially a wrapper for CreateSurface().
It checks whether the texture's got Alpha, (line 535)
checks the texture's size against the max texture size (for the 256x256 limit on Voodoo cards), makes rectangular textures square if the renderer so desires. (line 548, calling a function defined on 431).
Then it ets scaling factor (line 555), so that textures larger than whatever the max texsize is get downsampled to the max texsize (but I can't find where that happes).
Then it creates and locks the surface, copies the pixels into it (setting the alpha values on the fly (604)), unlocks the texture (681)
checks to see whether the renderer accepts the texture (?) (684) and bugs out if it doesn't.
Then it does a lot of stuff with the video ram that my D3D knowledge is insufficient to understand (696-765) sets a couple more values
and then it exits.
Not the most succesful function specification I ever gave, but it might just put you back on track. Let us know how you fare :D.
-
I like this guy :)
-
Who is he?
Is he working for us? And if not, why not?
-
yay, someone who actualy knows what there doing
(as opposed to me;)):nod:
-
he beat me to it, i just started looking at it and i came across it. great work
-
I think I have a handle on this thing now. Thanks guys.
-
I seem to have made a little progress, I think I have textures directly loading from pcx. Everything is in the right place but the palette is totally messed up. Yet again everything is blue! Wish you guys could see it, its really funny.
However jittery ani's were trying to play so Im definely on the right track. Will post when I have more details. Im not going to checkin till I have a lot more sorted out than this.
Progres though, progress!
-
PCX's load, theres no need for that TGA crap anymore.
However all is not well. I have decided to stick with 16 bit textures for now but ani's are kind of working.
- [l]Ani's load and play but VERY slowly and seem to interfere with each other[/l]
- [l]Most 2D alpha polys have gone missing[/l]
- [l]No font[/l]
- [l]I have introduced a major series of video memory leaks, doh[/l]
- [l]16 bit mode crashes[/l]
Old problems that still exist
- [l]Blue lighting[/l]
- [l]Thruster polys draw in wrong order[/l]
- [l]Ship polys flicker through each other[/l]
However this is still very good progress I think.
The memory leaks are regretable but they come hand in hand with working ani's.
Im still wanting coding help.
-
what was wrong with the blue?
-
Its not supposed to be blue. The color should be neutral unless impacted on by a star and its stars.tbl color. Later, I would like to get source code changes to set FRED tools to do sun color and ambient color independant of star bitmaps.
-
I'm sorry for posting again, so sue me. :D
Have you looked at the first post in this thread. In the pic did you notice that the Subach HL-7's were blue, and the textures were blue? Well after changing tons of code, that's what he came up with. Now after doing more changing, I think he's got a fix for it. Since it was crossed out in the last post, I assume yu've resolved it. It looks it's coming along quite nicely actually.
Okay Random Tiger, from your list it looks like you've fixed the HUD and blue graphics. I think I might have an idea about the backgrounds, but I'm not sure it would work, or if its been suggested. Anyway, I'm not a coder, so I know jack. Anyway, how's it looking? Can we expect DX8 support in the next source code release?
-
you got the blue shadeing thing fixed?
great,
could we get a screen of what you have now
-
The blue lighting was a very silly mistake my me :o
If anyone else had been in the code as well, it would have been spotted.
That picture is out of date. OK, I guess I could put up a new shot.
As for DX8 in the next release that depends on, when the next release is, how much coder help I have, how well the tester list works with tracking down all the card specific bugs and how long it takes to sort out all these bugs.
I wouldnt get excited, DX8 is unlikely to offer direct benifits except perhaps a modist speed increase. This is step 1 of 2. Step two is hardware T&L, once we have that done we are in business.
After DX8 is done, AND ONLY ONCE ALL THE BUGS ARE IRONED OUT FOR EVERYONE, we should make an effort to add some stuff that excites non coders, like ability to handle nice big 32 bit textures and optimise for speed etc.
-
(http://www.ijbrooks.demon.co.uk/tom/dx8_1.jpg)
This shows the thruster problem, but other stuff working
(http://www.ijbrooks.demon.co.uk/tom/dx8_2.jpg)
No HUD! Also this shows the extend of the ordering problem!
-
Topper work, still :) I'm bloody impressed at the progress, considering how long you've been working on it ;)
Er, keep it up.
-
the ordering problem seems very weird! Since I assume you've changed only the lower-level code, and left the high level interface alone, that should not be happening, as the polies are supposed to be sent in the exact same order as they were with the original code.
It seems as if Z-buffering is disabled, since even if they were sent in a wrong order, they should've drawn correctly with z-bufferiong on, which means it's probably some state-change you've missed.
-
i must be blind or sumting what exactly is "better" in those pics?
-
Originally posted by Ashrak
i must be blind or sumting what exactly is "better" in those pics?
it's not blue anymore obviously :rolleyes:
the guy tries to make the thing working for DX8, if you want to compare to the normal FS2 and spot what looks better, I suggest you read this thread a few times, maybe you'll understand...
-
Originally posted by Fry_Day
the ordering problem seems very weird! Since I assume you've changed only the lower-level code, and left the high level interface alone, that should not be happening, as the polies are supposed to be sent in the exact same order as they were with the original code.
Replacing the z buffer code was straight forward and I dont think I've disrupted any state changes so Im really at a loss.
OK, Im not trying to be mean but this thead is intended for coders. Could people *please* not fill it with crap. As venom points out most answers are in the thread if you can just read it from the start.
From now on only coders, or people who really know what they are talking about, PLEASE!
-
Nothings better...yet. (Check the post before the pic ;))
Step 1 is to get DX8 working the same as DX5 (what the current FS2 uses). Once that is done, then the cool stuff can be added, that's step 2.
RandomTiger, I'm almost set up at home so if you have something specific that a DX8 neophyte could work on, just e-mail me and let me know.
-
Current jobs are:
[l]1. Most 2D alpha polys have gone missing and no font
2. I have introduced a major series of video memory leaks, doh
3. 16 bit mode crashes
4. Thruster polys draw in wrong order and ship polys flicker through each other and draw in the wrong order, especially if its something big.[/l]
I'm on job 2, Unknown Player is on job 1.
So its a choice between 3 and 4 I guess.
Righteous1, Im not sure if I know who you are, got you confused with Eternal 1 for a moment, give me an e-mail and tell me which job you want to try and give me an idea of your coding experience and I'll give you all the details I can on the job.
Also tell me your specs, including gfx card.
Same goes for any other coders who want to help out. Im not technically team leader on DX8 but I've done the vast majority of the code so far and know the most about the problems, and why they might have occured.
-
np, I'm new around here :)
I sent you an e-mail with the info. Just let me know if I can help.
-
Righteous has been thru the "interview" process and has CVS access. He's the guy that was doing the NASA related stuff ;)
-
Oh yes! I remember now, sorry theres so many new people runnng around Im loosing track of who everyone is.
He should call himself 'NASA guy', I would if I was him :)
-
Originally posted by RandomTiger
Oh yes! I remember now, sorry theres so many new people runnng around Im loosing track of who everyone is.
He should call himself 'NASA guy', I would if I was him :)
True, Righteous1 sounds so normal that I can't relate that nick to this famous NASA guy. lol :D
-
:rolleyes:
Hehe, everyone associates NASA with leading edge technology. The sad state of the space program is, unless you work in one of the research areas (JPL, Ames, etc) You're working with very dated technology.
Space Shuttle = 70's tech
Space Station = 80's tech
I had to leave NASA mainly because technically I was getting left behind :( It was a fun job though.
Oh, to keep on topic...I'll get the 8.1 SDK downloaded tonight :D
-
Originally posted by Ashrak
i must be blind or sumting what exactly is "better" in those pics?
Okay, like its been sayed, everything isn't blue. And the backgrounds are rendering correctly. keep up the good work RandomTiger! Judging fromt eh posts it looks like you've been rebuilding Freespace 2 almost from the ground up.
You have WAY to much free time;) :D Not that it's a bad thing in this case.
-
For those of youw who want to debate the virtues of DirectX8 and what benefits it may have (and you know who you are)...please take it to another thread. RandomTiger is looking for some help with the coding...and some educated opinions on how to fix it, not someone to say "Ooh a picture...so what?".
Thats got to be very hurtful to the people working on this.
-
Just a wee note. Not sure about in DX5 but in DX8 ICQ plays hell with FS2. You have to minimize it or bad things happen.
-
Update: Looks like I've got those memory leaks sorted out.
Just merging the code with UP's stuff then I'll commit it.
I'll take the only job left, the polygon order problem.
Although I'll probably take a peek at the others if I get bored.
-
any way to draw the alpha polys like normal ones instead of projecting them?
-
That wont work. In FS2 everything is projected.
Doing that would probably just put it behind everything even if it should be infront.
-
Originally posted by RandomTiger
He should call himself 'NASA guy', I would if I was him :)
Pssst...admins...member title :D
-
Anyway, back on topic it looks like I've got z-buffer sorting fixed.
The problem was a combination of my stupidity and DX8 documentation being less than thorough.
I'll just do a bit more testing and check it inwhen I have a minute.
-
things are going well I see
btw, about your sig, WTF???
-
so what bugs still remain
-
Crashes in 16 bit
Alpha problems with HUD, font and some graphics
Flipping problem on a non Geforce card.
-
hahahahahaha
check out Hades' signiture:
Newbies, you read the FAQ? You stil got questions?
[url]http://www.geocities.com/hades6189/fs2newbie.html?1033908701843[url/]
he's telling the newbies to go to a URL, but he doesn't even know how to correctly make it a link HAHAHAHHAHAHAHA n00b ;) lol
j/k
-
I fail to see how this relates to the DX8 upgrade.
Perhaps you could have put this somewhere more relevent.
Ironically Hades newbie forum might be the place.
-
Looks like I might have fixed 16 bit bug.
Currently testing.
-
Fixed 16 bit, current state:
(http://www.ijbrooks.demon.co.uk/tom/dxnow.jpg)
Alpha bugs ahoy!
-
I think I have fixed the font and the HUD :)
Edit: Yep, its sorted.
Though we've still got the other alpha bug to sort out that leaves black around planets, messagebox, the cursor and 16 bit ani's
-
I think I'll start looking into the code seriously. Where's the current CVS server?
Btw, the message box and planet black zones must be missed state-changes (no enabling blending (planet) or masking (message box)
-
D'oh, double post
-
Originally posted by Fry_Day
I think I'll start looking into the code seriously. Where's the current CVS server?
Btw, the message box and planet black zones must be missed state-changes (no enabling blending (planet) or masking (message box)
http://www.3dactionplanet.com/hlp/hosted/fsscp/
Must is a bit of a strong word. Seems likely but dont think I've missed out any state changing code, it should be working because thats the way it worked before.
Originally posted by Fry_Day
D'oh, double post
A lot of that going around at the moment.
-
I kinda forgot to mention, but masking (sprites having sharp edges) is achieved by first drawing the blending the screen color with black (drawing the bitmap with the D3D comparable blending function to glBlendFunc(GL_DST_COLOR,GL_ZERO)), and then drawing again with the render state set to D3DBLEND_ONE, D3DBLEND_ONE
Edit: I used the OpenGL function there since it should be easily translated to D3D, and my knowledge of D3D syntax is even worse than my limited OpenGL knowledge
-
you do know that the transparency used around planets and cursors and that mesage box are all diferent to the transparency used for the hud and the other alpha blending stuff, namely it uses pure green (000,255,000) to signify total transparency, I'd look into that (and while you're looking for this might be good to keep an eye out for the ND stuff) to see were it assigns transparency.
-
Its picking up the green and making it alpha correctly, whats ND stuff?
-
NonDarkening, I don't know if there's any way to get that working at all in D3D though
-
its some glide thing, if i knew any i'd probably look at it.
-
Originally posted by Stealth
hahahahahaha
check out Hades' signiture:
he's telling the newbies to go to a URL, but he doesn't even know how to correctly make it a link HAHAHAHHAHAHAHA n00b ;) lol
j/k
OT-
Newbie site, newbie link. :rolleyes:
EDIT: Just to put in my two cents. In case you were wondering ( probably not ) HUD, and nebulas use black as transparent, and cursors, mainhall anims, and planets use pure green. It seems that you could use either black or green for transparent on backgrounds. Or maybe it is green for planets, and black for nebs.
-
Current bugs:
[l]1. Remaining alpha bug (cursor, messagebox, planet, etc)[/l]
[l]2. Nebula no fog and lack of ship trails[/l]
3. Crashes when switching
[l]4. When lucifer ani plays it looks odd (small)[/l]
[l]5. I need to sortout the rest of the texture system[/l]
This sub-project as definately lost its momentum but still, its not far off completion.
-
Don't give up dude!!! I have great faith in you :) And the rest of the team btw
When you finish the DX8 convertion, you will open brand new doors... erm I mean subspace tunnels, to other fantastic things... keep it up :)
-
Bug 4 is really part of bug 1.
Getting 5 done could give me an oppertunity to fix 1.
I have an angle of 3, I just need someone to take a look at 2 which might not strictly speaking be a DX bug but just some engine bug thats popped up or been introduced.
-
ALPHA BUG DOWN, REPEAT ALPHA BUG DOWN!
-
Nice going RT.
-
Sweet! Sounds like its coming along very nicely!
-
what is #3, what is it switching?
-
crashes if you alt tab or another program maximises its self, not good cos thats what may video playing code sadly needs to do.
Bob, did you get my e-mail?
I need help from any coder whos willing, you shouldnt need to know anything about DX8. One bug requires you to find what should be a small mistake and the other one requires Win32 experience.
Please help and we can get this finished off!
-
Tried out the DX8 build now... Played several missions and found no crashes or oddities... seems you guys know your stuff :)
Will alt+tab ability come back?
I'd appreciate it a lot if it was possible as I use it all the time :)
I feel loading time has gone up a notch, especially during start and exit of the game. It's not horrible though. Just that the loading times actually felt faster on my old 500mhz... Perhaps MHz has nothing to do with it, I wouldn't know.
However it seems like the mouse lag in the menu's I had in the original and the old opensource-build is virtually gone. That was nice.
geforce2 GTS 32mb, AMD-1800XP, 512mb pc2100.
hope this was the right thread to post those thoughts...
-
Originally posted by wamingo
Tried out the DX8 build now... Played several missions and found no crashes or oddities... seems you guys know your stuff :)
Well, you are GF owner so it was always going to be OK for you, seems theres still a few problems on other systems.
Will alt+tab ability come back?
I'd appreciate it a lot if it was possible as I use it all the time :)
Its listed as a bug so it should get sorted out. My video code still switches so its high priority to keep it working with that. In short, yes.
I feel loading time has gone up a notch, especially during start and exit of the game.
However it seems like the mouse lag in the menu's I had in the original and the old opensource-build is virtually gone. That was nice.
These two things are related, the game does more preloading so it doesnt have to be pushing stuff around when its meant to be displaying things.
The loading code is quite stupid and frees stuff it needs and then reloads it, if someone was to sort this out it would load a damn sight quicker, particurally between missions.
hope this was the right thread to post those thoughts...
Not really, but who cares :)