Commit Graph

57 Commits (668fd219cc7d18ca3887ea0125a694edaea02747)

Author SHA1 Message Date
Levin Li 668fd219cc Render lines with triangles 2021-01-03 17:21:55 +08:00
Levin Li e2b9598f17 Always use gl_PointSize in shader to set point size 2020-12-04 19:46:32 +08:00
Levin Li b465017de8 Support fisheye projection, dumb version 2020-11-20 23:52:23 +08:00
Levin Li 17cd02b3cc Add view port effect for post processing 2020-10-10 20:18:15 +08:00
Levin Li 1f150db611 separate modelview and projection 2020-10-06 13:39:09 +08:00
Hleb Valoshka c588f80824 OpenGL ES 2.0 initial support 2020-06-15 19:27:46 +03:00
Hleb Valoshka 1fb1f2de91 Replace fixed function GL code with GL ES compatible one 2020-05-12 15:59:56 +03:00
Hleb Valoshka c26faf70e2 Remove "simple" shaders 2020-04-30 10:23:19 +03:00
Hleb Valoshka b781d7a7c8 Add "unlit" shader lighting model 2020-04-30 10:23:19 +03:00
Hleb Valoshka 845c1a5454 Fix keys compare in ShaderManager 2020-04-06 20:30:46 +03:00
Hleb Valoshka e5d54df6bb Initial implementation of self shadowing
Known bugs and limitations:
  * Only the 1st light source casts shadows.
  * Thin objects have incorrect shadows, see ISS.
2020-04-03 11:31:09 +03:00
Hleb Valoshka 87a551ede7 Fix number of bits used for shadows
Fixes red bodies as reported in #565, and possibly #583
2020-01-12 14:56:15 +03:00
Hleb Valoshka 35b53b22d5 Refactor simple shader generation 2019-08-02 14:34:25 +03:00
Hleb Valoshka 239063306c Add a method to get arbitrary attribute location 2019-07-02 10:29:31 +03:00
Hleb Valoshka 5f9fa3c2d4 Add Mat3/4ShaderParameter classes 2019-07-02 10:29:31 +03:00
Hleb Valoshka 9745b125f3 Support for static shaders in ShaderManager 2019-06-21 13:57:04 +03:00
Hleb Valoshka dbd7090117 Make ShaderManager private property of Renderer 2018-12-11 20:32:13 +03:00
Hleb Valoshka 2377b0089c Draw constellation boundaries using glsl 2018-10-26 00:22:54 +03:00
Hleb Valoshka 717bf3413d Rewrite star rendering using GLSL
Shader manager needs more attention though.
2018-10-23 00:03:39 +03:00
Hleb Valoshka 5e84d0e3e3 Free some memory allocations explicitly, found by vagrant
I found strange issue when Celestia is built using cmake: the program
was aborted with "corrupted size vs. prev_size" message.

GDB showed address as `delete[] text` in Console::~Console(), while there
was not double free().

Vargant showed "incorrect delete/delete[]/realloc" for
ShaderManager.shaders.

Now it's gone.
2018-10-20 19:39:12 +03:00
Hleb Valoshka 73638c116d Remove basictypes.h and use standard c++11 types 2018-09-22 23:42:03 +03:00
Hleb Valoshka b082d5f47f Automatically convert to c++11 using clan-tidy
+ manual cleanups
2018-09-22 23:42:02 +03:00
Hleb Valoshka 882e4ecf28 fix whitespaces and indents
trailing spaces are removed
tabs are replaced with 4 spaces

# Conflicts:
#	src/celengine/cmdparser.cpp
#	src/celengine/command.cpp
#	src/celestia/celestiacore.cpp
#	src/celestia/celestiacore.h
#	src/celestia/qt/qtappwin.cpp
#	src/celestia/qt/qtglwidget.cpp
#	src/celestia/win32/winmain.cpp
2018-09-22 23:41:57 +03:00
Chris Laurel 52b1dccdff Fixed eclipse shadows on non-spherical planets (especially noticeable on
Saturn.) Fix affects the GLSL/OpenGL 2.0 render path only.
2010-04-23 22:14:44 +00:00
Chris Laurel dcf9232c08 Refactored some shadowing/eclipse code in the renderer
- Enabled ring shadows on moons and other objects that aren't themselves surrounded by
  ring systems.
- Use texture LOD bias to add blurriness to ring shadows (a result of the finite
  size of the light source.)
- Calculate ring phase function per-pixel instead of per-vertex
- Implemented more realistic rendering of unlit side of ring systems
- Used new Eigen's NewStdVector for vectors containing fixed-sized vectorizable
  objects.
2009-10-27 22:02:01 +00:00
Chris Laurel afd7c78574 More Eigenization changes. 2009-08-06 00:41:24 +00:00
Chris Laurel 157b720854 Removed more code that used the old vector classes. 2009-08-05 21:13:29 +00:00
Chris Laurel 921d694fee Fixed bugs and improved accuracy of eclipse shadows in OpenGL 2.0 path:
- Very faint shadows (where the occulting object appeared much smaller than the sun) were being rendered completely black. This is now fixed.
- Maximum shadow depth and umbra (or antumbra) radius are now accurately calculated for all eclipses
- Extremely faint shadows are culled for performance
2008-12-30 02:20:33 +00:00
Chris Laurel 0b545dd55a Fixes for planetshine in OpenGL 2.0 shaders:
- Added light brightness parameter for shader; required in order for night textures to look right in some multiple light source situations.
- Added castsShadows property for light sources. Shadows are not rendered for planetshine light sources.
2008-09-22 20:57:27 +00:00
Chris Laurel 600a2a2ab0 Improve support for per-vertex colors (unlit models only right now.) 2008-08-07 00:42:18 +00:00
Da Woon Jung e59f4b4b54 HDR bloom, adaptive exposure, calibrated nightlights - disabled by default, enable with USE_HDR and HDR_COMPRESS. 4 new vertex programs added. 2008-03-25 00:23:16 +00:00
Chris Laurel a1f4551b0a - Switched to using ARB_texture_cube_map instead of obsolete EXT_texture_cube_map
- Changed fade distance for constellation labels
- Enabled fading for constellation boundaries
- Prevented rendering planets as points in daytime sky
- Enabled REFMARK in render.cpp
- Removed dead code
2007-12-30 20:11:26 +00:00
Chris Laurel 079e04aad7 Changed shaders so that night texture blend factor can be computed in the pixel shader instead of the vertex shader, which saves an extra interpolator. 2007-05-15 18:14:57 +00:00
Chris Laurel 36d0299d78 Added limited support for per-vertex colors in meshes. 2007-04-23 17:39:38 +00:00
Chris Laurel f178284186 Added emissive light model for GLSL render path: elminates need to revert to fixed function paths when rendering emissive meshes. 2007-04-20 17:49:43 +00:00
Chris Laurel 6454b452d4 Mesh rendering bug fixes and improvements:
- Defined a sensible lighting model to use when normals are omitted from a model, which should prevent crashes in the Mac version
- Added support for point sprites in cmod meshes
2007-04-02 16:55:32 +00:00
Chris Laurel 54d5de0563 - Added support for emissive color to OpenGL 2.0 render path
- Eliminated code for Lommel-Seeliger photometric model, since it's just a special case of the more general Lunar-Lambert model.
- Cleaned up GLSL_RenderContext so it uses the light and shadow functions in the shader manager
2006-09-03 23:22:07 +00:00
Chris Laurel 75e4ce8ec4 Added support for compressed normal maps. 2006-09-01 18:19:26 +00:00
Chris Laurel 1cc0b38fde Enable new atmospheres to work for irregular objects.
Moved parameter setup for atmospheres, lighting, and shadows into the CelestiaGLProgram class.
2006-08-29 06:13:41 +00:00
Chris Laurel f515f93399 New atmosphere changes:
- Moved calculation of phase function from vertex shader to fragment shader; this avoids some tessellation artifacts
- Use separate functions for generating atmosphere shaders
2006-08-27 00:02:05 +00:00
Chris Laurel 856a05d6f6 Added lunar-Lambert photometric model for much more realistic rendering of the moon and similar bodies. 2006-08-08 17:19:57 +00:00
Chris Laurel 370655d004 Enabled opacity attribute in the OpenGL 2.0 render path. 2006-08-07 17:23:09 +00:00
Chris Laurel 27bfdea411 Added new photometric functions and atmospheric scattering model. 2006-08-07 06:40:45 +00:00
Chris Laurel 063ec093d3 - Implemented cloud textures
- Changed eclipse shadow shaders to use just a single interpolant for all shadows rather than one interpolant per shadow. This will prevent Celestia from generating uncompilable shaders when there are many eclipse shadows
2006-07-12 17:39:24 +00:00
Chris Laurel f3326dd39f - Added per-pixel specular lighting for GLSL path; can work either with or without bump mapping
- Turn on separate specular color when rendering models (not required for GLSL path)
- Fixed completely broken calculation of object space eye position for GLSL shaders
2006-07-09 02:03:29 +00:00
Chris Laurel dc7ce8986a Improved rendering of meshes in GLSL path:
- Switched to local viewer model for better quality specular highlights
- Added support for specular and normal maps for meshes
- Implemented shadows for meshes (cast by ellipsoids only, not from other meshes yet.)
2006-07-04 05:03:27 +00:00
Chris Laurel 2afe62f5a5 Made overlay textures work in the GLSL render path. 2006-05-17 10:21:58 +00:00
Chris Laurel 91340872da Implemented correct shadows for clouds in GLSL path. 2004-11-02 18:39:08 +00:00
Chris Laurel 19a5e12f11 GLSL shader fixes:
- Changed int constants to floats so shaders compile on ATI drivers
- Dump error messages to shaders.log along with shader source
- When shader compilation fails, subsitute an error shader that outputs red pixels
2004-10-27 09:44:41 +00:00
Chris Laurel d119912cff - Fixed bug that caused specular color to be ignored when shadows were turned enabled, resulting in overbright specular highlights.
- Ring rendering was broken in the GLSL path when shadows were disabled.  Fixed.
2004-10-25 08:18:13 +00:00