New screenshots from engine

This is a discussion on New screenshots from engine within the Game Programming forums, part of the General Programming Boards category; ah, bum lol. Well anyway, just fyi iv found imageshack.us to be a good host for images, though i have ...

  1. #31
    #junkie
    Join Date
    Oct 2004
    Posts
    240
    ah, bum lol. Well anyway, just fyi iv found imageshack.us to be a good host for images, though i have only used avatars and sigs thus far.
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  2. #32
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Tell me what you think of this alpha blending. I'm trying to fade out the planets in the distance. I'm not sure what I think of it.

  3. #33
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    I think a fog effect would look better for fading planets in the distance. Im not a huge fan of the alpha blending there.

  4. #34
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    I'm not sure how to fog them. The problem is the Material structure is a DWORD created from 4 floats 0.0f to 1.0f. But when they are in memory they are DWORDs. So accessing the colors is a bit tricky because I would have to re-create a D3DXCOLOR object thus creating another constructor call per color (ambient, diffuse, specular, and emissive) per planet. I could store the original RGB values for these colors in the planet class and then the function could simply take these, alter them as needed, and store the result in the new color - but still retain the original RGB values. This would allow me to fade the colors out.

    However I gain something with the alpha blending. It seems that D3D will not push polies down the pipeline that have an alpha of 0. To support this check out the frame time for this frame. I'm usually up around .0014 and in the shot its at .0013. The only change to the code was the alpha blending code. So it's a type of culling if you will.

    But I agree.....I don't like it either.

  5. #35
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    Quote Originally Posted by Bubba
    Rotating objects to match their velocity vector
    Now I know how to compute a velocity vector from one point in space to another, but I'm not sure how to actually rotate the object to match the given vector orientation. Just simply using the normalized vector components for rotation does not work. The normalized vector will always fall in the range 0 to 1.0f, but the D3DXRotation functions expect a value from -PI to PI.




    Try just rotating on the axis proportionaly to their unit vector of velocity
    uv.x * pi/2
    uv.y * pi/2
    uv.z * pi/2
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  6. #36
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Bubba, not sure if you saw my post in the other thread, but here is the relevant part of it:
    Quote Originally Posted by Hunter2
    Code:
    if (laser->Properties.LifeTimer>laser->Properties.LifeDistance)
    {
    if (laser!=Lasers.end())
    {
    This just seems somewhat odd, since you're checking if the iterator is valid AFTER you've already dereferenced it, but I assume that you're already aware of this.

    From what I see in your code, every time you delete a laser, the iterator will skip the next laser: You delete the laser, assign the iterator to the next laser, and then you hit the end of the loop and the iterator increments again; thus you've skipped the laser in between. So if you have an odd number of iterators:

    0) You have 3 elements
    1) Delete element 0, iterator now points to element 0 (previously element 1)
    2) Do something with element 0, increment iterator; now points to element 1 (formerly 2)
    0b) You now have 2 elements, iterator points to element 1 (last)
    1b) Delete this element, iterator now points to end
    2b) If iterator != end, do nothing; increment iterator; now points 1 beyond end
    0c) You now have 1 element, iterator points beyond the end of the sequence (still != end).
    1c) Try to dereference it, and BOOM! kablooey, your loop crashes.

    One quick solution I can think of is, stick it in a while loop and do the iterator management by hand (if you erase an element, don't increment iterator).
    I hope that's the solution to your problem I ran into that some time ago, couldn't figure out why my various bullets/lasers travelled at different speeds in Space Shooterz.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  7. #37
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    So when you erase the object don't do lasers++? Okay then what does the current laser point to. According to the STL it would point to the next object..........nevermind I just figured out what you were saying. A big bright light came on in that last sentence.

    Since it points to the next one in the list, the iterator has implicitly already been incremented. When my loop then iterates it again....I've skipped an object in the vector.

    Thanks a million. I will try it out ASAP.


    I've also come across another solution to the skybox code. I originally started with a sky sphere but decided it took way too many triangles just to produce a nice space backdrop. Then I moved to a skybox which takes only 12 triangles and 6 textures but it takes a lot more indices since duplicating texture coords at the vertexes results in very weird texturing. Since the vertexes overlap you must specify all of them independently because they all hold different texture coords. Try it and you will see.

    Now I've come across another idea from my book Real Time Rendering by Moller and Haines. Instead of using a skybox I could use a simple textured quad at the far clip plane and to simluate scrolling I just translate the texture u,v coords. Since I've already done this in Direct3D with my terrain engine to achieve moving clouds I can readily use that class.

    So my space backdrop will actually just be a huge quad that is drawn first with the correct texture coords based on camera's orientation. Then I draw everything else on top of this. It's similar to my sun glare quad and in fact will use a derivation of this class. The sun glare is drawn last and alpha blended with the destination image which produces a nice bright glare on the screen. What this new technique will enable me to do is produce one large texture and simply scroll it on the quad. It also allows me to use fog such as when your spacecraft is in a nebula and I WON'T get those ugly fog artifacts associated with skyboxes. Try it. When you fog a skybox too far into the distance...the fog builds up in the corners of your skybox and basically your corner's stick out like sore thumbs. This completely destroys the illusion you are trying to create with the skybox.

    I think I might actually gain some frames with this method as well. I'm eliminating 10 very large triangles and 5 textures. I also do not have to compute any rotation values (except for perhaps Z which would be a simple 2D rotation of the u,v coords) which also saves CPU cycles. No translation, no world matrix, etc., etc. Also I won't get the perspective problem associated with skyboxes. You must create special textures or change the texture mapping to eliminate the perspective distortion in your skybox which is a pain. Perspective is what you want in 3D, but not in a skybox. It doesn't look cool when the left and right sides of the box are skewed due to perspective. It just doesn't look good at all.

    Will have screenies shortly. Prob won't scrap the skybox code and in fact I still have the skysphere code - just in case I don't like the new technique.

    EDIT:

    HURRAH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!HURRAH!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    I changed the vector code to use a while loop, only incremented the iterator if I was not erasing an object..............and it works beautifully. All lasers are updated correctly and destroyed as well. So what was basically going on was the old-fashioned array bounds overrun...with an STL flavor to it. I'm going to change my sound system code to fix this bug as well. Thats probably why my SAFE_RELEASE(Segment) is crashing so hard. It's probably a result of the vector fragging memory and then screwing something else up totally unrelated to it. Don't ya love C++?

    Again..............thanks a million, billion, trillion. You just fixed my project and allowed me to correctly use vectors.............for lots of other stuff.

    You da man!!

    Last edited by VirtualAce; 11-29-2004 at 08:50 AM.

  8. #38
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Always glad to help I remember, this particular bug had me stumped for about a month; when pairs of lasers were fired in parallel, mysteriously the ones on the left would begin to pull ahead of the ones on the right. I later realized that the problem was, when the lasers go off the screen they get erased.. but then that skips one laser in my loop, which also happens to handle movement. Thus as a laser is erased, another one falls behind by one frame.

    I was quite puzzled for a long time
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  9. #39
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Here is a sample with the scrolling backdrop implemented. Notice how much more detail I can squeeze in. This is a portion of a 2048x2048 backdrop texture.

    I like the backdrop better. It really conveys the vastness of the system.

  10. #40
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    And another shot looking at the sun. Notice I fogged out the planets that are far away.

    The 2D looks good in the screenies, but I need to adjust the texture u,v ratios to fit the screen and also to match 360 degrees. In other words it should rotate so that in 2048 pixels you go through a complete 360 degrees of rotation. Otherwise the effect is lost and it nearly gives you a headache cuz your brain expects to see one thing and yet is seeing something else. The old brain is not good at visualizing graphical paradoxes which is what this is - 3D combined with 2D.

  11. #41
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    So, since you've got this crazy graphics engine and all.. are you going to be taking into account the delay that it takes for light to reach you over long distances, and time distortion as you approach the speed of light? Or light-bending effects of a blackhole?

    J/k, looks really good.. keep it up!
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  12. #42
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Actually the blackhole...yes. The rest of it - prob not.

    The blackhole will not trap light since light is what makes 3D - well 3D. If I kill the light the game is useless. I might alter the ambient light as you approach the hole...but I'm not sure.

    Anyways gravity will be simulated in the sim according to the following equation.

    G=6.67 * 10^-11

    Force=(O1mass-O2mass)*G/(distance^2)

    I will have to integrate this over time of course in order to get it to work right.

  13. #43
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    The blackhole will not trap light since light is what makes 3D - well 3D. If I kill the light the game is useless. I might alter the ambient light as you approach the hole...but I'm not sure.
    I thought blackholes bend light too, if the light goes too close to it without going past the event horizon? And then there's the whole space-time distortion mumbo jumbo It sure would be neat if looking at the blackhole, you instead saw something behind you.

    >>Force=(O1mass-O2mass)*G/(distance^2)
    Isn't it Fg = G(mass1)(mass2)/dist^2?
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  14. #44
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Um....yep....it is. Don't know where I got mass1-mass2. Too many vector algos running through my head I reckon.

    Bending light eh? Well I have tossed around the idea of making one caste's space ships totally reflective like the Naboo race in the new (but not improved) Star Wars. This would require generating new cube maps in real time and then rendering the cube map onto the object using environment mapping. Very cool effect if I can pull it off. Vertex/Pixel shaders anyone?

  15. #45
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    id say just use a sphere map of your background texture. Its not a true reflection but its a quick simulation of one. Of course it will look funny if you get close to a planet and dont see its reflection. I guess it depends on how the game play will be.

Page 3 of 4 FirstFirst 1234 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In a game Engine...
    By Shamino in forum Game Programming
    Replies: 28
    Last Post: 02-19-2006, 10:30 AM
  2. Game Engine Link Prob
    By swgh in forum Game Programming
    Replies: 2
    Last Post: 01-25-2006, 11:14 PM
  3. Ultra chess engine contest
    By yodacpp in forum Projects and Job Recruitment
    Replies: 8
    Last Post: 11-21-2004, 06:58 AM
  4. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 11:38 AM
  5. Game structure, any thoughts?
    By Vorok in forum Game Programming
    Replies: 2
    Last Post: 06-07-2003, 01:47 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21