Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Tolwyn on January 17, 2007, 02:32:20 pm
-
I've been working on a 3d planet for FS2 and ran into a small problem. How do I implement atmospheric glow? Obviosly I can't use a falloff map (like I do in max). Would a glow point work? Any ideas? :)
-
This idea MAY work. Render a map of the fall off as a texture, create a plane and apply that texture, and put it over the planet and position it just right in game so that it creates that illusion.
-
Does a glowmap not work for whatever you have in mind?
-
I think he wants it to extend out around the planet.
-
I was trying to think of a way to make a glowmap work, but it'd all involve a flat plane rather than a planet model... so I think you may end up having to wait for shaders...
-
do what vengence says but make the sprite plane with the glow a subobject. then script it so that it always faces the player. then you can fly around it and it would look right from every angle.
-
My problem would be that you would allways have the same amount of glow around the object don't you? I mean a bright atmo on the dark side of the planet?
-
......do you really travel that far in the game to get all the way around the model?
Or do you mean if it rotates about its axis?
-
you can change the orientation of subobjects in the scripting. youd run a script that makes sure the atmoshpere plane always faces the player. youl always see the atmo halo around the planet because your always looking at it straight on. in other words the atmosphere turns by its self so that its always facing you.
-
you can change the orientation of subobjects in the scripting. youd run a script that makes sure the atmoshpere plane always faces the player. youl always see the atmo halo around the planet because your always looking at it straight on. in other words the atmosphere turns by its self so that its always facing you.
now that's an idea. :) Uh, yeah, but how? :D
In fact you do travel quite a lot in WC Saga. And I think passing a planet is simply magnificent. At any rate, the only drawback is that the halo around the planet will have same intencity at all times, but I guess we can't help it. At leats not till shaders arrive.
Anyway, are there any tutorials around for scripting? None on the team has used it before :(
-
EDIT: nevermind
-
In fact you do travel quite a lot in WC Saga. And I think passing a planet is simply magnificent. At any rate, the only drawback is that the halo around the planet will have same intencity at all times, but I guess we can't help it. At leats not till shaders arrive.
Oh man, I didn't know you were doing it for WC.
-
In fact you do travel quite a lot in WC Saga. And I think passing a planet is simply magnificent. At any rate, the only drawback is that the halo around the planet will have same intencity at all times, but I guess we can't help it. At leats not till shaders arrive.
what's the difference? :)
It is still FS2 engine :D
Oh man, I didn't know you were doing it for WC.
-
The biggest problem here is to get the atmospheric glow to mach the shape of the planet visible. If you make a static glow sprite that always faces the player, you'll end up with rather strange situation when half of the planet is illuminated but you still see the atmospheric glow in the dark side.
Here's an option: Make a shell around the planet. The shell must always face the player.
Then texture that shell so that only the half facing the player has a texture, rest is transparent. The texture must be faded towards the edges, so that when the shell is viewed from the viewpoint, it appears as a round blob with indefinite edges. That should cause an illusion of fading, even though the model's surface itself would be solid. And the local light source would take care of making the atmosphere visibe in appropriate places, especially if the shell would be a subobject of the planet.
-
hmm... I am not sure how to achieve this effect. Wouldn't it affect surface visibility as well?
-
Obviously. That's what atmosphere does. The key is to find the correct opacity level and blur it towards the edges, so that the atmosphere seems to blur out into the void on the edges. That way the atmosphere doesn't tint the whole planet overly blue or turquoise (or whatever colour you want the atmo to be), while it still retains visibility when observed against dark space.
The blur does not only affect around the planet. It affects the whole visible surface of the planet. But as the typical albedo of a habitable planet is in most cases much bigger than darkness of empty space, the diffuse light from atmosphere blends into the surface reflections and isn't as easily observable as it is against the darkness of space. But believe me, the diffuse atmospheric light covers pretty much all of the planet. :)
EDIT: You could also make it so that the texture is actually BEHIND the planet, but extends somewhat over the edges to make the glow appear. I would put it in the front, but both ways would work.
-
Yeah, I know what you mean. And I can do it in MAX. I just do not know how to implement your suggestion into the game...
-
you can change the orientation of subobjects in the scripting. youd run a script that makes sure the atmoshpere plane always faces the player. youl always see the atmo halo around the planet because your always looking at it straight on. in other words the atmosphere turns by its self so that its always facing you.
That's what I would use, but I too have no specific idea of the syntax to achieve that. Mathematic part is easy, though...
The script needs to get the planet location P1(X1,Y1,Z1) and player's location P2(X2,Y2,Z2). After that it's easy to calculate the attitude vector for the atmosphere shell subobject thingamaroo. In composite form, the vector will always be
s = P1->P2 = (X2-X1)i + (Y2-Y1)j + (Z2-Z1)k
I don't know if these co-ordinates should be converted to polar space co-ordinates with pitch and heading values (or latitude, longitude) somewhere along the road, but that's how you could do it, and then the atmosphere diffuse shell would always face the player.
I really need to learn Lua scripting... :rolleyes: It's just I don't have too much spare time. :mad:
-
I really need to learn Lua scripting... :rolleyes: It's just I don't have too much spare time. :mad:
Same here. I simly do not have the time. :(
I do hope that someone can help me here though :D
-
You could use glowpoints at planets.
High-res image DXT5 with mipmaps(!) and kill the player ship, if the player gets too close.
(Or place an invisilbe collision box around the glowpoint.
Just in case the player uses time compression to get there. :drevil:
Ok... the planet will always look the same. But if it's really far away, you might not even notice it. ;)
-
You could use glowpoints at planets.
High-res image DXT5 with mipmaps(!) and kill the player ship, if the player gets too close.
(Or place an invisilbe collision box around the glowpoint.
Just in case the player uses time compression to get there. :drevil:
Ok... the planet will always look the same. But if it's really far away, you might not even notice it. ;)
That was the plan. Btw, would the glow point work if I lay an autopilot route around the planet?
-
This would be SO much easier if autopilot was not a consideration.
-
well a glowpoint cant be lighted as well as a subobject, but it will always face the viewpoint withot overly complicated scripting. a subobject also has the problem that it will be drawn before the planet, so youd only see the edges.
you can change the orientation of subobjects in the scripting. youd run a script that makes sure the atmoshpere plane always faces the player. youl always see the atmo halo around the planet because your always looking at it straight on. in other words the atmosphere turns by its self so that its always facing you.
That's what I would use, but I too have no specific idea of the syntax to achieve that. Mathematic part is easy, though...
The script needs to get the planet location P1(X1,Y1,Z1) and player's location P2(X2,Y2,Z2). After that it's easy to calculate the attitude vector for the atmosphere shell subobject thingamaroo. In composite form, the vector will always be
s = P1->P2 = (X2-X1)i + (Y2-Y1)j + (Z2-Z1)k
I don't know if these co-ordinates should be converted to polar space co-ordinates with pitch and heading values (or latitude, longitude) somewhere along the road, but that's how you could do it, and then the atmosphere diffuse shell would always face the player.
I really need to learn Lua scripting... :rolleyes: It's just I don't have too much spare time. :mad:
im still trying to learn how the orientation matrix works. its not that hard to figure out which way an object is facing just create a vector at some set angle, like 0,1,0, then orientation:unrtateVector(vector) it to the orientation of the subobject. then you add the unrotated vector to the subobject position. this vector essentially points in whatever direction the subobject is rotated to. though im not sure how to tell an object what vector to point to. right now you can only really borrow a matrix from another object. id like to be able to generate a matrix from a vector or a few vectors. though i may be able to do it with whats there now after a crash course in calculus. :D
-
doesn't the orientation object give you access to the f,r,and u vecs?
well if you want to know wich was an object is looking the last row of the matrix is it's fvec
BTW in regards to the thread, have you consitered just makeing a sphere with it's normals fliped, I think that might look alright so long as you don't get too close, the big problem being that it will have a hard egde.
-
bottom row huh, good to know :D
it gives you a 3x3 indexed 1-9 as well as the p,h,b.
or you can just wait for them shaders :D
-
yeah, it's
rvec[x,y,z]
uvec[x,y,z]
fvec[x,y,z]
as you can see 3X3,
further when the matrix is in it's identity state, the rvec points to the right [1,0,0], uvec points up [0,1,0] and fvec points forward [0,0,1] :)
-
ok that helps alot. i might actually figure theese damn matrices out someday :D