Jump to content
  • Advertisement
Sign in to follow this  

some source code i put together....

This topic is 4105 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all. i have to share some source code that i have extract from my main programm. atm iam working on a 3d screen saver. my first real 3d programm. 2 days ago i found that something was missing in my screen saver. in the screen saver my spaceship was flying arround from planet to planet. but it looked very static so i wanted to add some kind of speed feeling effect like in freelancer. so that when the ship is moving lines will show up and move in the direction of the ship. so i looked arround on web but didnt find anything that where usefull for my screen saver. the only thing i found on web was some moving star demo that uses drawprimitive call for each point. another attempt i found was a moving starfield that locked the vertex buffer every frame and move new vertices to it. so i made this effect with an hlsl shader for this kind of effect. the effect needs only 1 DrawIndexedPrimitive call to show all the flying lines. there are no vertex locks. the effect works with 1 static buffer and 1 index buffer. i have put some other basic stuff into the source code to show beginners like me how to load a mesh, extract data from it, clone a mesh, display a nice background. some features of the demo are: ------------------------------ loading an effect file. loading textures loading x-file and clone the mesh to a new vertex format. extracting data from a loaded mesh and move it to an vertex buffer. frame buffer alpha blending working with vertex-element and declarations building matrices and passing it to an effect. i have tried to write infos on the most thing i do in the source code and the shader. so it should be easy to understand the code. since the shader is very easy it can be expand to make other things. with the same technique i have written other shaders for my screen saver for particle animations that runs on the gpu. for effects like smoke, fire, beams, clouds..... ok hope some beginners in directx can use this kind of effect or find some nice things in my source code. dont wonder about the size of the main code. this is just because iam using the DXUT Framework. so alot of things are init code from the library. the programm was done with visual c++ 2005 express edition. directx 9.0c sdk ( August 2006 ) sorry about the length of the file. but i include 2 nice nebula bmp's that i found on the web. i have reworked this maps with PsP so that there are seamless now and can be use for a nice background. would be nice if someone can write me an email or post here how he would do some effect like describe above. you can download the source code and exe from here: http://www.file-upload.net/download-210922/Stars.rar.html again sorry for alot of spelling errors here and in my source code. - Andrex

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!