2001-11-27 18:50:04 -07:00
|
|
|
// render.h
|
|
|
|
//
|
|
|
|
// Copyright (C) 2001, Chris Laurel <claurel@shatters.net>
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
#ifndef _RENDER_H_
|
|
|
|
#define _RENDER_H_
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <celengine/observer.h>
|
2002-01-07 15:48:32 -07:00
|
|
|
#include <celengine/universe.h>
|
2001-11-27 18:50:04 -07:00
|
|
|
#include <celengine/selection.h>
|
2003-02-19 10:48:25 -07:00
|
|
|
#include <celengine/glcontext.h>
|
2004-09-19 21:27:50 -06:00
|
|
|
#include <celengine/starcolors.h>
|
2005-02-10 23:09:37 -07:00
|
|
|
#include <celengine/rendcontext.h>
|
2001-11-27 18:50:04 -07:00
|
|
|
#include <celtxf/texturefont.h>
|
|
|
|
|
|
|
|
|
2002-11-03 21:14:07 -07:00
|
|
|
struct RenderListEntry
|
|
|
|
{
|
|
|
|
const Star* star;
|
|
|
|
Body* body;
|
|
|
|
Point3f position;
|
|
|
|
Vec3f sun;
|
|
|
|
float distance;
|
|
|
|
float radius;
|
|
|
|
float nearZ;
|
|
|
|
float farZ;
|
|
|
|
float discSizeInPixels;
|
|
|
|
float appMag;
|
|
|
|
bool isCometTail;
|
2004-06-26 02:22:20 -06:00
|
|
|
int depthBucket;
|
2004-11-11 02:41:51 -07:00
|
|
|
int solarSysIndex;
|
2002-11-03 21:14:07 -07:00
|
|
|
};
|
|
|
|
|
2004-11-11 02:41:51 -07:00
|
|
|
static const unsigned int MaxSolarSystems = 16;
|
2004-10-19 11:52:43 -06:00
|
|
|
|
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
class Renderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Renderer();
|
|
|
|
~Renderer();
|
2004-03-15 11:51:16 -07:00
|
|
|
|
|
|
|
struct DetailOptions
|
|
|
|
{
|
|
|
|
DetailOptions();
|
|
|
|
unsigned int ringSystemSections;
|
|
|
|
unsigned int orbitPathSamplePoints;
|
|
|
|
unsigned int shadowTextureSize;
|
|
|
|
unsigned int eclipseTextureSize;
|
|
|
|
};
|
|
|
|
|
|
|
|
bool init(GLContext*, int, int, DetailOptions&);
|
2001-11-27 18:50:04 -07:00
|
|
|
void shutdown() {};
|
|
|
|
void resize(int, int);
|
|
|
|
|
2003-01-01 16:48:15 -07:00
|
|
|
float calcPixelSize(float fov, float windowHeight);
|
2002-12-11 13:27:35 -07:00
|
|
|
void setFaintestAM45deg(float);
|
|
|
|
float getFaintestAM45deg();
|
2001-11-27 18:50:04 -07:00
|
|
|
|
|
|
|
void setRenderMode(int);
|
2002-09-22 08:51:35 -06:00
|
|
|
void autoMag(float& faintestMag);
|
2001-11-27 18:50:04 -07:00
|
|
|
void render(const Observer&,
|
2002-01-07 15:48:32 -07:00
|
|
|
const Universe&,
|
2001-11-27 18:50:04 -07:00
|
|
|
float faintestVisible,
|
2003-02-21 23:49:37 -07:00
|
|
|
const Selection& sel);
|
2001-11-27 18:50:04 -07:00
|
|
|
|
|
|
|
enum {
|
2003-07-04 18:22:01 -06:00
|
|
|
NoLabels = 0x000,
|
|
|
|
StarLabels = 0x001,
|
|
|
|
PlanetLabels = 0x002,
|
|
|
|
MoonLabels = 0x004,
|
|
|
|
ConstellationLabels = 0x008,
|
|
|
|
GalaxyLabels = 0x010,
|
|
|
|
AsteroidLabels = 0x020,
|
|
|
|
SpacecraftLabels = 0x040,
|
|
|
|
LocationLabels = 0x080,
|
|
|
|
CometLabels = 0x100,
|
2006-03-08 11:29:10 -07:00
|
|
|
NebulaLabels = 0x200,
|
|
|
|
OpenClusterLabels = 0x400,
|
2005-07-21 16:35:18 -06:00
|
|
|
I18nConstellationLabels = 0x800,
|
2003-07-04 18:22:01 -06:00
|
|
|
BodyLabelMask = (PlanetLabels | MoonLabels | AsteroidLabels | SpacecraftLabels | CometLabels),
|
2001-11-27 18:50:04 -07:00
|
|
|
};
|
2002-02-17 21:00:07 -07:00
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
enum {
|
2002-02-17 21:00:07 -07:00
|
|
|
ShowNothing = 0x0000,
|
|
|
|
ShowStars = 0x0001,
|
|
|
|
ShowPlanets = 0x0002,
|
|
|
|
ShowGalaxies = 0x0004,
|
|
|
|
ShowDiagrams = 0x0008,
|
|
|
|
ShowCloudMaps = 0x0010,
|
2003-07-08 09:31:34 -06:00
|
|
|
ShowOrbits = 0x0020,
|
2002-02-17 21:00:07 -07:00
|
|
|
ShowCelestialSphere = 0x0040,
|
|
|
|
ShowNightMaps = 0x0080,
|
|
|
|
ShowAtmospheres = 0x0100,
|
|
|
|
ShowSmoothLines = 0x0200,
|
|
|
|
ShowEclipseShadows = 0x0400,
|
2002-02-28 15:12:26 -07:00
|
|
|
ShowStarsAsPoints = 0x0800,
|
2002-04-16 03:32:55 -06:00
|
|
|
ShowRingShadows = 0x1000,
|
2002-06-04 23:27:53 -06:00
|
|
|
ShowBoundaries = 0x2000,
|
2002-06-22 09:16:27 -06:00
|
|
|
ShowAutoMag = 0x4000,
|
2002-09-08 21:50:37 -06:00
|
|
|
ShowCometTails = 0x8000,
|
2003-01-31 21:42:21 -07:00
|
|
|
ShowMarkers = 0x10000,
|
2004-06-01 01:27:17 -06:00
|
|
|
ShowPartialTrajectories = 0x20000,
|
2006-03-08 11:29:10 -07:00
|
|
|
ShowNebulae = 0x40000,
|
|
|
|
ShowOpenClusters = 0x80000,
|
2006-07-26 11:21:23 -06:00
|
|
|
ShowNewStars = 0x100000, // temporary, for debugging new star code
|
|
|
|
ShowCloudShadows = 0x200000,
|
2003-07-08 09:31:34 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
enum StarStyle
|
|
|
|
{
|
|
|
|
FuzzyPointStars = 0,
|
|
|
|
PointStars = 1,
|
|
|
|
ScaledDiscStars = 2,
|
|
|
|
StarStyleCount = 3,
|
2001-11-27 18:50:04 -07:00
|
|
|
};
|
2002-02-17 21:00:07 -07:00
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
int getRenderFlags() const;
|
|
|
|
void setRenderFlags(int);
|
|
|
|
int getLabelMode() const;
|
|
|
|
void setLabelMode(int);
|
|
|
|
float getAmbientLightLevel() const;
|
|
|
|
void setAmbientLightLevel(float);
|
2004-03-21 12:26:54 -07:00
|
|
|
float getMinimumOrbitSize() const;
|
2002-04-25 21:49:43 -06:00
|
|
|
void setMinimumOrbitSize(float);
|
2003-06-18 12:35:59 -06:00
|
|
|
float getMinimumFeatureSize() const;
|
|
|
|
void setMinimumFeatureSize(float);
|
2002-09-08 21:50:37 -06:00
|
|
|
float getDistanceLimit() const;
|
|
|
|
void setDistanceLimit(float);
|
2003-07-08 09:31:34 -06:00
|
|
|
int getOrbitMask() const;
|
|
|
|
void setOrbitMask(int);
|
2005-12-11 08:34:35 -07:00
|
|
|
int getScreenDpi() const;
|
|
|
|
void setScreenDpi(int);
|
2004-09-19 21:27:50 -06:00
|
|
|
const ColorTemperatureTable* getStarColorTable() const;
|
|
|
|
void setStarColorTable(const ColorTemperatureTable*);
|
2001-11-27 18:50:04 -07:00
|
|
|
|
|
|
|
bool getFragmentShaderEnabled() const;
|
|
|
|
void setFragmentShaderEnabled(bool);
|
|
|
|
bool fragmentShaderSupported() const;
|
|
|
|
bool getVertexShaderEnabled() const;
|
|
|
|
void setVertexShaderEnabled(bool);
|
|
|
|
bool vertexShaderSupported() const;
|
|
|
|
|
2003-02-19 16:25:26 -07:00
|
|
|
GLContext* getGLContext() { return context; }
|
|
|
|
|
2003-07-08 09:31:34 -06:00
|
|
|
void setStarStyle(StarStyle);
|
|
|
|
StarStyle getStarStyle() const;
|
2002-02-13 13:38:49 -07:00
|
|
|
void setResolution(unsigned int resolution);
|
|
|
|
unsigned int getResolution();
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2002-05-02 01:57:38 -06:00
|
|
|
void loadTextures(Body*);
|
|
|
|
|
2006-03-08 11:29:10 -07:00
|
|
|
static const int MaxLabelLength = 32;
|
2001-11-27 18:50:04 -07:00
|
|
|
typedef struct {
|
2006-03-08 11:29:10 -07:00
|
|
|
char text[MaxLabelLength];
|
2001-11-27 18:50:04 -07:00
|
|
|
Color color;
|
|
|
|
Point3f position;
|
|
|
|
} Label;
|
|
|
|
|
2006-03-08 11:29:10 -07:00
|
|
|
void addLabel(const char* text, Color, const Point3f&, float depth = -1);
|
|
|
|
void addLabel(const std::string&, Color, const Point3f&, float depth = -1);
|
|
|
|
void addSortedLabel(const std::string&, Color, const Point3f&);
|
2001-11-27 18:50:04 -07:00
|
|
|
void clearLabels();
|
2006-03-08 11:29:10 -07:00
|
|
|
void clearSortedLabels();
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2006-03-08 11:29:10 -07:00
|
|
|
enum FontStyle
|
|
|
|
{
|
|
|
|
FontNormal = 0,
|
|
|
|
FontLarge = 1,
|
|
|
|
FontCount = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
void setFont(FontStyle, TextureFont*);
|
|
|
|
TextureFont* getFont(FontStyle) const;
|
2001-11-27 18:50:04 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
// Internal types
|
|
|
|
// TODO: Figure out how to make these private. Even with a friend
|
|
|
|
//
|
|
|
|
struct Particle
|
|
|
|
{
|
|
|
|
Point3f center;
|
|
|
|
float size;
|
|
|
|
Color color;
|
|
|
|
float pad0, pad1, pad2;
|
|
|
|
};
|
|
|
|
|
2002-02-08 14:55:26 -07:00
|
|
|
struct RenderProperties
|
|
|
|
{
|
|
|
|
RenderProperties() :
|
|
|
|
surface(NULL),
|
|
|
|
atmosphere(NULL),
|
|
|
|
rings(NULL),
|
|
|
|
radius(1.0f),
|
2004-10-07 11:52:22 -06:00
|
|
|
semiAxes(1.0f, 1.0f, 1.0f),
|
2004-02-17 02:58:52 -07:00
|
|
|
model(InvalidResource),
|
2002-02-17 21:00:07 -07:00
|
|
|
orientation(1.0f),
|
2003-06-17 11:40:49 -06:00
|
|
|
locations(NULL)
|
2002-02-08 14:55:26 -07:00
|
|
|
{};
|
|
|
|
|
2002-02-13 13:38:49 -07:00
|
|
|
Surface* surface;
|
2002-02-08 14:55:26 -07:00
|
|
|
const Atmosphere* atmosphere;
|
|
|
|
RingSystem* rings;
|
|
|
|
float radius;
|
2004-10-07 11:52:22 -06:00
|
|
|
Vec3f semiAxes;
|
2004-02-17 02:58:52 -07:00
|
|
|
ResourceHandle model;
|
2002-02-08 14:55:26 -07:00
|
|
|
Quatf orientation;
|
2002-02-17 21:00:07 -07:00
|
|
|
std::vector<EclipseShadow>* eclipseShadows;
|
2003-06-17 11:40:49 -06:00
|
|
|
std::vector<Location*>* locations;
|
2002-02-08 14:55:26 -07:00
|
|
|
};
|
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
class StarVertexBuffer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StarVertexBuffer(unsigned int _capacity);
|
|
|
|
~StarVertexBuffer();
|
2006-03-08 11:29:10 -07:00
|
|
|
void start();
|
2001-11-27 18:50:04 -07:00
|
|
|
void render();
|
2002-02-25 13:29:32 -07:00
|
|
|
void finish();
|
2001-11-27 18:50:04 -07:00
|
|
|
void addStar(const Point3f&, const Color&, float);
|
|
|
|
void setBillboardOrientation(const Quatf&);
|
|
|
|
|
|
|
|
private:
|
|
|
|
unsigned int capacity;
|
|
|
|
unsigned int nStars;
|
|
|
|
float* vertices;
|
|
|
|
float* texCoords;
|
|
|
|
unsigned char* colors;
|
|
|
|
Vec3f v0, v1, v2, v3;
|
|
|
|
};
|
|
|
|
|
2004-10-04 00:35:33 -06:00
|
|
|
struct LightSource
|
|
|
|
{
|
|
|
|
Point3d position;
|
|
|
|
Color color;
|
|
|
|
float luminosity;
|
2004-10-19 11:52:43 -06:00
|
|
|
float radius;
|
2004-10-04 00:35:33 -06:00
|
|
|
};
|
|
|
|
|
2005-11-25 15:57:20 -07:00
|
|
|
|
|
|
|
class PointStarVertexBuffer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PointStarVertexBuffer(unsigned int _capacity);
|
|
|
|
~PointStarVertexBuffer();
|
2006-03-08 11:29:10 -07:00
|
|
|
void startPoints(const GLContext&);
|
|
|
|
void startSprites(const GLContext&);
|
2005-11-25 15:57:20 -07:00
|
|
|
void render();
|
|
|
|
void finish();
|
|
|
|
void addStar(const Point3f& f, const Color&, float);
|
2006-03-08 11:29:10 -07:00
|
|
|
void setTexture(Texture*);
|
2005-11-25 15:57:20 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
struct StarVertex
|
|
|
|
{
|
|
|
|
Point3f position;
|
|
|
|
float size;
|
|
|
|
unsigned char color[4];
|
|
|
|
float pad;
|
|
|
|
};
|
|
|
|
|
|
|
|
unsigned int capacity;
|
|
|
|
unsigned int nStars;
|
|
|
|
StarVertex* vertices;
|
|
|
|
const GLContext* context;
|
2006-03-08 11:29:10 -07:00
|
|
|
bool useSprites;
|
|
|
|
Texture* texture;
|
2005-11-25 15:57:20 -07:00
|
|
|
};
|
|
|
|
|
2003-05-25 20:27:27 -06:00
|
|
|
private:
|
|
|
|
struct SkyVertex
|
|
|
|
{
|
|
|
|
float x, y, z;
|
|
|
|
unsigned char color[4];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SkyContourPoint
|
|
|
|
{
|
|
|
|
Vec3f v;
|
|
|
|
Vec3f eyeDir;
|
|
|
|
float centerDist;
|
|
|
|
float eyeDist;
|
|
|
|
float cosSkyCapAltitude;
|
|
|
|
};
|
|
|
|
|
2005-11-18 02:00:39 -07:00
|
|
|
template <class OBJ> struct ObjectLabel
|
2004-02-28 02:30:17 -07:00
|
|
|
{
|
2005-11-18 02:00:39 -07:00
|
|
|
OBJ* obj;
|
|
|
|
std::string label;
|
|
|
|
|
|
|
|
ObjectLabel() :
|
|
|
|
obj (NULL),
|
|
|
|
label("")
|
|
|
|
{};
|
|
|
|
|
|
|
|
ObjectLabel(OBJ* _obj, const std::string& _label) :
|
|
|
|
obj (_obj),
|
|
|
|
label(_label)
|
|
|
|
{};
|
|
|
|
|
|
|
|
ObjectLabel(const ObjectLabel& objLbl) :
|
|
|
|
obj (objLbl.obj),
|
|
|
|
label(objLbl.label)
|
|
|
|
{};
|
|
|
|
|
|
|
|
ObjectLabel& operator = (const ObjectLabel& objLbl)
|
2004-02-28 02:30:17 -07:00
|
|
|
{
|
2005-11-18 02:00:39 -07:00
|
|
|
obj = objLbl.obj;
|
|
|
|
label = objLbl.label;
|
2004-02-28 02:30:17 -07:00
|
|
|
return *this;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2005-11-18 02:00:39 -07:00
|
|
|
typedef ObjectLabel<Star> StarLabel;
|
|
|
|
typedef ObjectLabel<DeepSkyObject> DSOLabel; // currently not used
|
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
private:
|
2003-02-14 11:07:47 -07:00
|
|
|
void setFieldOfView(float);
|
2001-11-27 18:50:04 -07:00
|
|
|
void renderStars(const StarDatabase& starDB,
|
|
|
|
float faintestVisible,
|
|
|
|
const Observer& observer);
|
2006-03-08 11:29:10 -07:00
|
|
|
void renderPointStars(const StarDatabase& starDB,
|
|
|
|
float faintestVisible,
|
|
|
|
const Observer& observer);
|
2005-11-18 02:00:39 -07:00
|
|
|
void renderDeepSkyObjects(const Universe&,
|
|
|
|
const Observer&,
|
|
|
|
float faintestMagNight);
|
2001-11-27 18:50:04 -07:00
|
|
|
void renderCelestialSphere(const Observer& observer);
|
|
|
|
void renderPlanetarySystem(const Star& sun,
|
|
|
|
const PlanetarySystem& solSystem,
|
|
|
|
const Observer& observer,
|
|
|
|
double now,
|
2004-11-11 02:41:51 -07:00
|
|
|
unsigned int solarSysIndex,
|
2001-11-27 18:50:04 -07:00
|
|
|
bool showLabels = false);
|
2002-02-08 14:55:26 -07:00
|
|
|
|
|
|
|
void renderObject(Point3f pos,
|
|
|
|
float distance,
|
|
|
|
double now,
|
|
|
|
Quatf cameraOrientation,
|
|
|
|
float nearPlaneDistance,
|
|
|
|
float farPlaneDistance,
|
2004-10-04 00:35:33 -06:00
|
|
|
RenderProperties& obj,
|
|
|
|
const LightingState&);
|
2002-02-08 14:55:26 -07:00
|
|
|
|
2003-06-24 00:31:19 -06:00
|
|
|
void renderPlanet(Body& body,
|
2001-11-27 18:50:04 -07:00
|
|
|
Point3f pos,
|
|
|
|
float distance,
|
|
|
|
float appMag,
|
|
|
|
double now,
|
|
|
|
Quatf orientation,
|
2004-11-11 02:41:51 -07:00
|
|
|
const vector<LightSource>& lightSources,
|
2001-11-27 18:50:04 -07:00
|
|
|
float, float);
|
2002-02-08 14:55:26 -07:00
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
void renderStar(const Star& star,
|
|
|
|
Point3f pos,
|
|
|
|
float distance,
|
|
|
|
float appMag,
|
|
|
|
Quatf orientation,
|
|
|
|
double now,
|
|
|
|
float, float);
|
2002-02-08 14:55:26 -07:00
|
|
|
|
2002-06-16 20:41:11 -06:00
|
|
|
void renderCometTail(const Body& body,
|
|
|
|
Point3f pos,
|
|
|
|
float distance,
|
|
|
|
float appMag,
|
|
|
|
double now,
|
|
|
|
Quatf orientation,
|
2005-12-11 08:34:35 -07:00
|
|
|
const vector<LightSource>& lightSources,
|
2002-06-16 20:41:11 -06:00
|
|
|
float, float);
|
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
void renderBodyAsParticle(Point3f center,
|
|
|
|
float appMag,
|
2002-01-23 18:21:53 -07:00
|
|
|
float _faintestMag,
|
2001-11-27 18:50:04 -07:00
|
|
|
float discSizeInPixels,
|
|
|
|
Color color,
|
|
|
|
const Quatf& orientation,
|
|
|
|
float renderDistance,
|
|
|
|
bool useHaloes);
|
2006-03-08 11:29:10 -07:00
|
|
|
void renderObjectAsPoint(Point3f center,
|
|
|
|
float appMag,
|
|
|
|
float _faintestMag,
|
|
|
|
float discSizeInPixels,
|
|
|
|
Color color,
|
|
|
|
const Quatf& orientation,
|
|
|
|
float renderDistance,
|
|
|
|
bool useHaloes);
|
2002-02-17 21:00:07 -07:00
|
|
|
|
2003-05-25 20:27:27 -06:00
|
|
|
void renderEllipsoidAtmosphere(const Atmosphere& atmosphere,
|
|
|
|
Point3f center,
|
|
|
|
const Quatf& orientation,
|
|
|
|
Vec3f semiAxes,
|
|
|
|
const Vec3f& sunDirection,
|
|
|
|
Color ambientColor,
|
|
|
|
float fade,
|
|
|
|
bool lit);
|
|
|
|
|
2003-06-17 11:40:49 -06:00
|
|
|
void renderLocations(const vector<Location*>& locations,
|
2003-08-01 00:32:43 -06:00
|
|
|
const Quatf& cameraOrientation,
|
2003-06-17 11:40:49 -06:00
|
|
|
const Point3f& position,
|
|
|
|
const Quatf& orientation,
|
|
|
|
float scale);
|
|
|
|
|
2004-10-19 11:52:43 -06:00
|
|
|
bool testEclipse(const Body& receiver,
|
|
|
|
const Body& caster,
|
|
|
|
const DirectionalLight& light,
|
|
|
|
double now,
|
|
|
|
vector<EclipseShadow>& shadows);
|
2002-02-17 21:00:07 -07:00
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
void labelConstellations(const AsterismList& asterisms,
|
|
|
|
const Observer& observer);
|
|
|
|
void renderParticles(const std::vector<Particle>& particles,
|
|
|
|
Quatf orientation);
|
2006-03-08 11:29:10 -07:00
|
|
|
void renderLabels(FontStyle fs);
|
2004-05-18 11:31:26 -06:00
|
|
|
std::vector<Label>::iterator renderSortedLabels(std::vector<Label>::iterator,
|
2006-03-08 11:29:10 -07:00
|
|
|
float depth,
|
|
|
|
FontStyle fs);
|
2003-01-31 21:42:21 -07:00
|
|
|
void renderMarkers(const MarkerList&,
|
|
|
|
const UniversalCoord& position,
|
|
|
|
const Quatf& orientation,
|
|
|
|
double jd);
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2002-03-19 17:28:43 -07:00
|
|
|
void renderOrbit(Body*, double);
|
2002-03-21 15:38:35 -07:00
|
|
|
void renderOrbits(PlanetarySystem*, const Selection&, double,
|
|
|
|
const Point3d&, const Point3d&);
|
2005-07-25 10:38:09 -06:00
|
|
|
void renderForegroundOrbits(const PlanetarySystem* system,
|
|
|
|
const Point3f ¢er,
|
|
|
|
float distance,
|
|
|
|
float discSizeInPixels,
|
|
|
|
const Selection& sel,
|
|
|
|
double t);
|
2003-02-19 16:25:26 -07:00
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
private:
|
2003-02-19 10:48:25 -07:00
|
|
|
GLContext* context;
|
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
int windowWidth;
|
|
|
|
int windowHeight;
|
|
|
|
float fov;
|
2005-12-11 08:34:35 -07:00
|
|
|
int screenDpi;
|
2002-09-22 08:51:35 -06:00
|
|
|
float corrFac;
|
2001-11-27 18:50:04 -07:00
|
|
|
float pixelSize;
|
2002-12-11 13:27:35 -07:00
|
|
|
float faintestAutoMag45deg;
|
2006-03-08 11:29:10 -07:00
|
|
|
TextureFont* font[FontCount];
|
2001-11-27 18:50:04 -07:00
|
|
|
|
|
|
|
int renderMode;
|
|
|
|
int labelMode;
|
|
|
|
int renderFlags;
|
2003-07-08 09:31:34 -06:00
|
|
|
int orbitMask;
|
2001-11-27 18:50:04 -07:00
|
|
|
float ambientLightLevel;
|
|
|
|
bool fragmentShaderEnabled;
|
|
|
|
bool vertexShaderEnabled;
|
|
|
|
float brightnessBias;
|
|
|
|
|
|
|
|
float brightnessScale;
|
|
|
|
float faintestMag;
|
2002-01-23 18:21:53 -07:00
|
|
|
float faintestPlanetMag;
|
2001-12-11 00:40:53 -07:00
|
|
|
float saturationMagNight;
|
|
|
|
float saturationMag;
|
2003-07-08 09:31:34 -06:00
|
|
|
StarStyle starStyle;
|
2001-11-27 18:50:04 -07:00
|
|
|
|
|
|
|
Color ambientColor;
|
2003-06-08 21:57:43 -06:00
|
|
|
std::string displayedSurface;
|
2001-11-27 18:50:04 -07:00
|
|
|
|
|
|
|
StarVertexBuffer* starVertexBuffer;
|
2006-03-08 11:29:10 -07:00
|
|
|
PointStarVertexBuffer* pointStarVertexBuffer;
|
|
|
|
PointStarVertexBuffer* glareVertexBuffer;
|
2001-11-27 18:50:04 -07:00
|
|
|
std::vector<RenderListEntry> renderList;
|
|
|
|
std::vector<Particle> glareParticles;
|
|
|
|
std::vector<Label> labels;
|
2004-05-18 11:31:26 -06:00
|
|
|
std::vector<Label> depthSortedLabels;
|
2004-10-19 11:52:43 -06:00
|
|
|
std::vector<EclipseShadow> eclipseShadows[MaxLights];
|
2004-10-02 04:44:49 -06:00
|
|
|
std::vector<const Star*> nearStars;
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2004-11-11 02:41:51 -07:00
|
|
|
std::vector<LightSource> lightSourceLists[MaxSolarSystems];
|
2004-10-04 00:35:33 -06:00
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
double modelMatrix[16];
|
|
|
|
double projMatrix[16];
|
|
|
|
|
|
|
|
bool useCompressedTextures;
|
|
|
|
bool useVertexPrograms;
|
|
|
|
bool useRescaleNormal;
|
2005-11-25 15:57:20 -07:00
|
|
|
bool usePointSprite;
|
2002-09-22 19:59:15 -06:00
|
|
|
bool useClampToBorder;
|
2002-02-13 13:38:49 -07:00
|
|
|
unsigned int textureResolution;
|
2002-03-19 17:28:43 -07:00
|
|
|
|
2004-03-15 11:51:16 -07:00
|
|
|
DetailOptions detailOptions;
|
2006-03-08 11:29:10 -07:00
|
|
|
|
|
|
|
bool useNewStarRendering;
|
2004-03-15 11:51:16 -07:00
|
|
|
|
2004-06-01 01:27:17 -06:00
|
|
|
public:
|
|
|
|
struct OrbitSample
|
|
|
|
{
|
|
|
|
double t;
|
|
|
|
Point3f pos;
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
2002-03-19 17:28:43 -07:00
|
|
|
struct CachedOrbit
|
|
|
|
{
|
|
|
|
Body* body;
|
2004-06-01 01:27:17 -06:00
|
|
|
std::vector<OrbitSample> trajectory;
|
2002-03-19 17:28:43 -07:00
|
|
|
bool keep;
|
|
|
|
};
|
|
|
|
std::vector<CachedOrbit*> orbitCache;
|
2002-04-25 21:49:43 -06:00
|
|
|
|
|
|
|
float minOrbitSize;
|
2002-09-08 21:50:37 -06:00
|
|
|
float distanceLimit;
|
2003-06-18 12:35:59 -06:00
|
|
|
float minFeatureSize;
|
2003-06-23 08:04:28 -06:00
|
|
|
uint32 locationFilter;
|
2003-05-25 20:27:27 -06:00
|
|
|
|
|
|
|
SkyVertex* skyVertices;
|
|
|
|
uint32* skyIndices;
|
|
|
|
SkyContourPoint* skyContour;
|
2004-09-19 21:27:50 -06:00
|
|
|
|
|
|
|
const ColorTemperatureTable* colorTemp;
|
2001-11-27 18:50:04 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _RENDER_H_
|