Jump to content
  • Advertisement
  • entries
    743
  • comments
    1924
  • views
    584184

Some progress (added new vid)

Sign in to follow this  
Aardvajk

1033 views

Making some decent progress on the game over the last few days.

First up, I implemented a billboard-based particle system, used for the torch effect in the video above. It uses the following sprite atlas that I stole from the internet somewhere and generates a dynamic vertex buffer each frame. Since I only need a position and a texture coordinate in the vertex structure, I decided to use triangle lists rather than indexed buffers for this case and it performs pretty well.

fireatlas.png

Next up, I've started work on implementing shadow mapping from an omni-directional point light. This uses the usual method of rendering depth into a texture cube then projecting this onto the scene. Here's one face of the texture cube, false coloured but you get the idea.

image0.png

I'm actually using D3DFMT_R32F format for the first time. I have previously used D3DFMT_A8R8G8B8 and packed/unpacked the depth into the colour channels but I've noticed I seem to get much better results using a floating point texture format and I believe this is supported pretty much everywhere now.

The video is using a cube map of dimension 512x512 and currently no PCF or filtering of any kind and looks okay. Some quick and dirty experiments suggest I can happily render eight shadow cubes a frame without dropping below 60 fps on my mid-range laptop, so I'm hoping that I can finally crack multiple point-light shadowing and lighting in this game.

The approach I want to take with multiple point lights is to have a consistent shadow colour and a consistent lit colour across the screen i.e. each shadowed pixel should be the same level of darkness and each visible pixel should be as if it has only been lit once.

I'm thinking vaguely about doing a first pass drawing everything as if it is in shadow, then clearing the z-buffer and doing a pass for each light where the pixel shader first tests to see if it is in shadow and discards the pixel if so. I'm not yet sure how to solve the "light once" problem for the pixels that are not in shadow, but plan to experiment to see if this is possible.

Anyway, that's all for now. Not a very technical entry and not like me to post no code, but there is nothing very interesting behind any of this in terms of C++ so we'll leave this here.

Thanks for stopping by.

[EDIT] I was asked by a non-technical friend how the fire effect worked so made the below video, not really aimed at you lot as you already understand billboard particle systems, I'm sure :)

Thought I'd stick it in here for posterity anyway. It's also on my Facebook. You never know, might manage to engage the interest of at least one non-programmer, weird bunch though they are :)

Sign in to follow this  


2 Comments


Recommended Comments

So you're actually coding the lighting yourself?!  That is really impressive.


It's just standard cube-map-based shadow mapping. But thank you :) Yes, this is all just using vanilla Direct3D 9 with a bit of D3DX support for texture loading and stuff.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!