If you are looking for a cool sun effect (no pun intended) with flaring corona, you’re in the right place. This post isn’t about some practical sun in some shooter though: it would require some tweaking to make it useful in such context, as the animation is rather cpu heavy due to its massive corona noise textures.
No, this post is about combining cool PV3D features in order to achieve a nice looking animated sun. I’ve used the trunk of the papervision code repository, revision 851 (it works up to r910, after that a bug was introduced). Note that I’m no PV3D guru; I’m just sharing what I’ve learned so far.
(note: this sun uses the skybox from the skybox tutorial)
| || |
/wp-content/uploads/2016/02/Suntutorial.swf, 400, 400
Closely watch that corona for a while!
Here’s a tutorial about a possible way to create planets and indeed Earth. I’ll briefly explain the main textures used and from then on go through the code step-by-step to explain what I did and why.
I had to tone down the size and fps, and leave out the bumpmap for this demo because my Opera browser was halting when I added the other images and clouds swf demo 😛
(notice the dynamic clouds and the glow around the globe)
| || |
/wp-content/uploads/2016/02/Planettutorial.swf, 500, 250
On my core 2 duo laptop I get about 20-25 fps whith a slightly larger stage size and the movie set to 30 fps. Although the planet looks very nice to me, I also realize it isn’t very practical for games or other realtime simulations. To get better fps, you can remove the bumpmap texture, replace the realtime clouds with a fixed texture, user fewer segments in the spheres, zoom out more, or use lower resolution textures for land- and cloud materials. A combination of two or more of these suggestions should easily get you above 35 fps.
Here’s a small class I made for adding realtime updates to DisplayObject3D objects. This class allows for easy time-based updates instead of the traditional frame-based updates.
I use the convention of adding update methods to all (my own) DisplayObject3D objects, which then update themselves according to preconfigured settings (eg. passed in the constructor). I pass in a Camera3D and that’s it, let the objects do their own thing. I’m making use of this convention by extracting this update method to a baseclass which then can do time-based updates instead.
Many space shooters use this concept where you are the pilot that looks out from the front window, lasering down enemies for bounty, right. Ever noticed spacedust? It’s very subtle when it is used, but it adds to the realism of outer space, making the space feel less empty, less static.
Here’s how you can do that in Papervision3D, using ParticleFields. I’ve used the trunk of the papervision code repository, revision 851, but it should work with the last release without to much hassle. Note that I’m no PV3D guru; I just started to learn this stuff and I’m just sharing what I’ve learned so far.
(note: space dust uses the skybox from the skybox tutorial)
| || |
/wp-content/uploads/2016/02/Spacedusttutorial.swf, 600, 300
Here’s how it works:
- divide space into a 3d grid and parts of the spacedust cloud on 8 gridpoints directly around the camera (the ship), we’ll call these dustpockets
- when the camera moves, dustpockets are removed and created to keep only the 8 gridpoints around the ship occupied