/* attempt to deal with prototype, bootstrap, jquery conflicts */ /* for dropdown menus */

Jump to content

Image of the Day

Day 17 -- a bunch more tools join the table :) #blender3d #screenshotsaturday #itssaturdaysomewhere #lowpoly #3D https://t.co/CYJucn0Lfv
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.

Sign up now

Properly rendering a starfield skymap

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Axiverse   Members   


Posted 23 July 2013 - 01:05 AM

I'm trying to render a starfield properly. I'm doing something similar to the new google maps zoomed out where you can see the entire planet and stars. However, right now in my implementation i'm basically drawing a sphere with the stars in the scene. When you zoom in or out the stars get zoomed in or out, but i think the right implementation is that they don't move. How would I properly render that?


basically right now the sky is a sphere(5000), and the earth is a sphere(10) and the camera moves in and out looking at the earth. when i zoom in, a narrower area of the sky is shown, I don't think this is correct, is it? Would I scale the sky inversely to the camera zoom? -> the more the camera is zoomed, the smaller the sky is?

#2 unbird   Members   


Posted 23 July 2013 - 02:05 AM

No, you shouldn't change the scale or projection. I think you confuse zooming - which basically changes the field of view of your perspective projection - with moving in or out (closer to and farther away from the earth). With zooming you also "scale the sky" - after all it's as if you would scale up or down the final image. When moving in/out the earth gets bigger/smaller due to perspective projection. Not so the skybox, it's supposed to look the same no matter where you are: A standard implementation moves the skybox mesh with the camera (your point of view) or even use a cubemap (which only cares about viewing direction).

#3 Kaptein   Prime Members   


Posted 24 July 2013 - 12:04 PM

createa a half-dome for sky with your atmospheric scatterer, and sphere-map a star-texture which you blend with enviroment depending on daylight level

i do it, and it works ok.. it's not a perfect spheremapping, and it never will be, because im cheap on the number of vertices

(and it converges on top/bottom, depending on your rotations)

i guess it's because im a programmer that i won't notice such things

maybe an artist would smile.png


EDIT: oops, i guess you are creating google stars? :) 

Edited by Kaptein, 24 July 2013 - 12:06 PM.

#4 LorenzoGatti   Members   


Posted 25 July 2013 - 10:02 AM

The star-textured sphere is an approximation because, since for numerical accuracy reasons the dome is small, those stars are much closer to the camera than they should be, causing exaggerated (i.e. detectable) parallax effects when the camera moves.

To suppress parallax, when rendering stars you should pretend that your camera rotates and zooms without moving: it's a simple matter of using a different transformation matrix in which the camera is in a fixed position (like the center of the planet or the point in which the simulation begins) but with its real orientation and magnification.

Omae Wa Mou Shindeiru

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.