Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low graphic mode? #3766

Open
mene99 opened this issue Jun 6, 2024 · 11 comments
Open

Low graphic mode? #3766

mene99 opened this issue Jun 6, 2024 · 11 comments
Labels
question Just a question, no change in code needed

Comments

@mene99
Copy link

mene99 commented Jun 6, 2024

Version 24.1 states LOW GRAPHIC MODE has been added.

How do i activate it?

Thank you

@gzotti
Copy link
Member

gzotti commented Jun 6, 2024

User Guide, section 6. In case you are running Windows, you may have to create a new program link and edit that. On UNIX-like systems you add this to the command line.

@mene99
Copy link
Author

mene99 commented Jun 6, 2024

I added the "--low-graphics" to the extension of the shortcut , the logo appears but the application fail to start , with no error displayed.
What could it be?

@gzotti
Copy link
Member

gzotti commented Jun 6, 2024

In case you are running Windows, these instructions may help. https://www.digitalcitizen.life/shortcut-arguments-parameters-windows/

@alex-w alex-w added the question Just a question, no change in code needed label Jun 7, 2024
@alex-w alex-w added this to Needs triage in OS: Windows via automation Jun 7, 2024
@mene99
Copy link
Author

mene99 commented Jun 7, 2024

I've added the shortcut extension properly, although the Application fails to start. It goes through the initial loading logo but then never starts. Not sure why. Same with ' -L '

@gzotti
Copy link
Member

gzotti commented Jun 7, 2024

Can we assume the application fails to start in default mode (without --low-graphics/-L) as well? Is that a Qt5- or Qt6-based build? On what hardware? The FAQ may provide more insights. If those are not enough, we might be able to help further if you provided a logfile.

@mene99
Copy link
Author

mene99 commented Jun 7, 2024

The application does not fail without the extensions. it's Qt6 based.

LOG:

2024-06-07T10:44:23
Operating System: Windows 10 Version 22H2
Compiled using MSVC 19.29.30153.0
Qt runtime version: 6.5.3
Qt compilation version: 6.5.3
Build ABI: x86_64-little_endian-llp64
Addressing mode: 64-bit
Processor architecture: x86_64
Processor name: Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
Processor maximum speed: 1498 MHz
Processor logical cores: 8
Total physical memory: 16384 MB
Video controller name: Intel(R) Iris(R) Plus Graphics
Video controller RAM: 1024 MB
Current resolution: 2736x1824
C:\Program Files\Stellarium\stellarium.exe --low-graphics 
 -------------------------------------------------------------
[ This is Stellarium 24.1 (v24.1.0) - https://stellarium.org/ ]
[ Copyright (C) 2000-2024 Stellarium Developers               ]
 -------------------------------------------------------------

Default surface format:  QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 1, colorSpace QColorSpace(), profile  QSurfaceFormat::NoProfile)
OpenGL module type: desktop OpenGL
Warning: Setting a new default format with a different version or profile after the global shared context is created may cause issues with context sharing.
Default surface format:  QSurfaceFormat(version 3.3, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 1, colorSpace QColorSpace(), profile  QSurfaceFormat::CoreProfile)
OpenGL module type: desktop OpenGL
StelGLWidget constructor
StelGraphicsScene constructor
initializeGL(windowWidth = 1368, windowHeight = 912)
OpenGL supported version:  "3.3.0 - Build 31.0.101.2125"
Current Format:  QSurfaceFormat(version 3.3, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QColorSpace(), profile  QSurfaceFormat::CoreProfile)
Initialization StelMainView
Luminance textures are not supported
Maximum texture anisotropy: 16
Maximum 2D texture size: 16384
Detected: OpenGL 3.3
Driver version string: 3.3.0 - Build 31.0.101.2125
GL vendor: Intel
GL renderer: Intel(R) Iris(R) Plus Graphics
GL Shading Language version: 3.30 - Build 31.0.101.2125
GLSL Version Number detected: 3.3
GLSL version is fine, we should not see a graphics problem.
stel.OpenGLArray: Vertex Array Objects are supported
Detected a high resolution device! Device pixel ratio: 2
Sky language: en_US
Empty translation file for language  "en_US" in section "stellarium-planetary-features"
Planetary features language: en_US
Application language: en_US
Scripts language: en_US
Cache directory: 
Loaded 252 countries
Loaded 193 regions
Loading Solar System data (1: planets and moons) ...
Loading from: ./data/ssystem_major.ini
Solar System has 83 entries.
Loaded 83 Solar System bodies
Loading Solar System data (2: minor bodies) ...
Loading from: 
Solar System has 227 entries.
Loaded 144 Solar System bodies
File ssystem_minor.ini is loaded successfully...
qt.gui.imageio: libpng warning: iCCP: profile 'ICC profile': 'RGB ': RGB color space not permitted on grayscale PNG
Loading nomenclature for Solar system bodies ...
qt.gui.imageio: libpng warning: iCCP: profile 'icc': 'GRAY': Gray color space not permitted on RGB PNG
Loaded 15939 / 15952 items of planetary surface nomenclature
INFO: Cannot find these planetary objects to assign nomenclature items: "Dactyl, Dimorphos"
Loading star data ...
Loading star catalog: .\stars\default\stars_0_0v0_8.cat - 0_0v0_8; 4979 entries
Loading star catalog: .\stars\default\stars_1_0v0_8.cat - 1_0v0_8; 21806 entries
Loading star catalog: .\stars\default\stars_2_0v0_8.cat - 2_0v0_8; 150826 entries
Loading star catalog: .\stars\default\stars_3_1v0_4.cat - 3_1v0_4; 425807 entries
Loading star catalog: C:\Users\A\AppData\Roaming\Stellarium\stars\default\stars_4_1v0_2.cat - 4_1v0_4; 1692779 entries
Loading star catalog: C:\Users\A\AppData\Roaming\Stellarium\stars\default\stars_5_2v0_1.cat - 5_2v0_1; 7083058 entries
Loading star catalog: C:\Users\A\AppData\Roaming\Stellarium\stars\default\stars_6_2v0_1.cat - 6_2v0_1; 24670782 entries
Loading star catalog: C:\Users\A\AppData\Roaming\Stellarium\stars\default\stars_7_2v0_1.cat - 7_2v0_1; 50733321 entries
Loading star catalog: C:\Users\A\AppData\Roaming\Stellarium\stars\default\stars_8_2v0_1.cat - 8_2v0_1; 92304337 entries
Finished loading star catalogue data, max_geodesic_level: 8
Loading scientific star names from .\stars\default\name.fab
Loaded 4942 / 4942 scientific star names
Loading scientific star extra names from .\stars\default\extra_name.fab
Loaded 26200 / 26200 scientific star extra names
Loading variable stars from .\stars\default\gcvs_hip_part.dat
Loaded 6862 / 6862 variable stars
Loading double stars from .\stars\default\wds_hip_part.dat
Loaded 22992 / 22992 double stars
Loading cross-identification data from .\stars\default\cross-id.dat
Loaded 108378 / 108378 cross-identification data records for stars
Loading parallax errors data from .\stars\default\hip_plx_err.dat
Loaded 117703 / 117703 parallax error data records for stars
Loading proper motion data from .\stars\default\hip_pm.dat
Loaded 117955 / 117955 proper motion data records for stars
navigation/preset_sky_time is a double - treating as jday: 2451514.25001
QOpenGLShader::compile(Vertex): ERROR: 0:2: '' : syntax error: #version directive must occur in a shader before anything else
ERROR: 0:2: '' : illegal order of preprocessor directives 


*** Problematic Vertex shader source code ***
#define lowp
#define mediump
#define highp
#line 1
#define ATTRIBUTE attribute
#define VARYING varying
#define texture2D_3(a,b,c) texture2D(a,b,c)
#define texture2DProj_3(a,b,c) texture2DProj(a,b,c)
#define shadow2D_x(a,b) shadow2D(a,b).x
#define shadow2DProj_x(a,b) shadow2DProj(a,b).x
#define textureCube_3(a,b,c) textureCube(a,b,c)
#line 1
ATTRIBUTE mediump vec2 pos;
ATTRIBUTE mediump vec2 texCoord;
ATTRIBUTE mediump vec3 color;
uniform mediump mat4 projectionMatrix;
VARYING mediump vec2 texc;
VARYING mediump vec3 outColor;
void main(void)
{
    gl_Position = projectionMatrix * vec4(pos.x, pos.y, 0, 1);
    texc = texCoord;
    outColor = color;
}

***
StelSkyDrawer::init(): Warnings while compiling vshader:  "ERROR: 0:2: '' : syntax error: #version directive must occur in a shader before anything else\nERROR: 0:2: '' : illegal order of preprocessor directives \n\n"
QOpenGLShader::compile(Fragment): ERROR: 0:2: '' : syntax error: #version directive must occur in a shader before anything else
ERROR: 0:2: '' : illegal order of preprocessor directives 


*** Problematic Fragment shader source code ***
#ifdef GL_KHR_blend_equation_advanced
#extension GL_ARB_fragment_coord_conventions : enable
#extension GL_KHR_blend_equation_advanced : enable
#endif
#define lowp
#define mediump
#define highp
#line 1
#define VARYING varying
#define FRAG_COLOR gl_FragColor
#define texture2D_3(a,b,c) texture2D(a,b,c)
#define texture2DProj_3(a,b,c) texture2DProj(a,b,c)
#define shadow2D_x(a,b) shadow2D(a,b).x
#define shadow2DProj_x(a,b) shadow2DProj(a,b).x
#define textureCube_3(a,b,c) textureCube(a,b,c)
#line 1
VARYING mediump vec2 texc;
VARYING mediump vec3 outColor;
uniform sampler2D tex;
void main(void)
{
    FRAG_COLOR = texture2D(tex, texc)*vec4(outColor, 1.);
}

***
StelSkyDrawer::init(): Warnings while compiling fshader:  "ERROR: 0:2: '' : syntax error: #version directive must occur in a shader before anything else\nERROR: 0:2: '' : illegal order of preprocessor directives \n\n"
QOpenGLShader::link: Attached vertex shader is not compiled.

StelPainter: Warnings while linking starShader shader program:
Attached vertex shader is not compiled.

QOpenGLShaderProgram::uniformLocation(projectionMatrix): shader program is not linked
QOpenGLShaderProgram::attributeLocation(texCoord): shader program is not linked
QOpenGLShaderProgram::attributeLocation(pos): shader program is not linked
QOpenGLShaderProgram::attributeLocation(color): shader program is not linked
QOpenGLShaderProgram::uniformLocation(tex): shader program is not linked
Loading DSO data ...
[...] Stellarium DSO Catalog, version 3.20 (standard edition)
Loaded 94660 DSO records
Loading DSO outline data ...
Loaded 98 DSO outline records successfully
Loading DSO discovery data ...
Loaded 183 / 183 DSO discovery records successfully
LandscapeMgr: initialized Cache for 100 MB.
QOpenGLShader::compile(Vertex): ERROR: 0:2: '' : syntax error: #version directive must occur in a shader before anything else
ERROR: 0:2: '' : illegal order of preprocessor directives 


*** Problematic Vertex shader source code ***
#define lowp
#define mediump
#define highp
#line 1
#define ATTRIBUTE attribute
#define VARYING varying
#define texture2D_3(a,b,c) texture2D(a,b,c)
#define texture2DProj_3(a,b,c) texture2DProj(a,b,c)
#define shadow2D_x(a,b) shadow2D(a,b).x
#define shadow2DProj_x(a,b) shadow2DProj(a,b).x
#define textureCube_3(a,b,c) textureCube(a,b,c)
#line 1
/*
 * Stellarium
 * Copyright (C) 2002-2022 Fabien Chereau and Stellarium contributors
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
 */

// Variables for the color computation
uniform highp vec3 sunPos;
uniform mediump float term_x, Ax, Bx, Cx, Dx, Ex;
uniform mediump float term_y, Ay, By, Cy, Dy, Ey;

// The current projection matrix
uniform mediump mat4 projectionMatrix;

// Contains the 2d position of the point on the screen (before multiplication by the projection matrix)
ATTRIBUTE mediump vec2 skyVertex;

// Contains the r,g,b,Y (luminosity) components.
ATTRIBUTE highp vec4 skyColor;

// The output variable passed to the fragment shader
VARYING mediump vec3 resultSkyColor;

vec3 xyYToRGB(highp float x, highp float y, highp float Y);

void main()
{
	gl_Position = projectionMatrix*vec4(skyVertex, 0., 1.);

	///////////////////////////////////////////////////////////////////////////
	// First compute the xy color component
	// skyColor contains the unprojected vertex position in r,g,b
	// + the Y (luminance) component of the color in the alpha channel
	highp vec3 unprojectedVertex = skyColor.xyz;
	highp float Y = skyColor.w;

	highp float cosDistSunq = dot(sunPos,unprojectedVertex);
	highp float distSun=acos(cosDistSunq);
	highp float oneOverCosZenithAngle = (unprojectedVertex.z==0.) ? 9999999999999. : 1. / unprojectedVertex.z;

	cosDistSunq*=cosDistSunq;
	highp float x = term_x * (1. + Ax * exp(Bx*oneOverCosZenithAngle))* (1. + Cx * exp(Dx*distSun) + Ex * cosDistSunq);
	highp float y = term_y * (1. + Ay * exp(By*oneOverCosZenithAngle))* (1. + Cy * exp(Dy*distSun) + Ey * cosDistSunq);
	if (x < 0. || y < 0.)
	{
		x = 0.25;
		y = 0.25;
	}

	resultSkyColor=xyYToRGB(x,y,Y);
}
/*
 * Stellarium
 * Copyright (C) 2002-2022 Fabien Chereau and Stellarium contributors
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
 */

const highp float pi = 3.1415926535897931;
const highp float ln10 = 2.3025850929940459;

uniform highp float alphaWaOverAlphaDa;
uniform highp float oneOverGamma;
uniform highp float term2TimesOneOverMaxdLpOneOverGamma;
uniform highp float term2TimesOneOverMaxdL;
uniform highp float brightnessScale; // Only the atmosphere fader value [0...1], i.e. drawn or not, or in transition.
uniform bool doSRGB;
uniform bool flagUseTmGamma;

float applyTMAndGamma(highp float Y)
{
	if (flagUseTmGamma)
	{
		// Y = std::pow(adaptLuminanceScaled(Y), oneOverGamma);
		return pow(abs(Y*pi*1e-4), alphaWaOverAlphaDa*oneOverGamma) * term2TimesOneOverMaxdLpOneOverGamma;
	}
	else
	{
		// Y = adaptLuminanceScaled(Y);
		return pow(abs(Y*pi*1e-4), alphaWaOverAlphaDa) * term2TimesOneOverMaxdL;
	}
}


vec3 xyYToRGB(highp float x, highp float y, highp float Y)
{
	///////////////////////////////////////////////////////////////////////////
	// Now we have the xyY components, need to convert to RGB

	vec3 color = vec3(1,0,1);
	// 1. Hue conversion
	// if log10Y>0.6, photopic vision only (with the cones, colors are seen)
	// else scotopic vision if log10Y<-2 (with the rods, no colors, everything blue),
	// else mesopic vision (with rods and cones, transition state)
	if (Y <= 0.01)
	{
		// special case for s = 0 (x=0.25, y=0.25)
		Y *= 0.5121445;
		Y = applyTMAndGamma(Y);
		color = vec3(0.787077, 0.9898434, 1.9256125) * Y * brightnessScale;
	}
	else
	{
		if (Y<3.9810717055349722)
		{
			// Compute s, ratio between scotopic and photopic vision
			float op = (log(Y)/ln10 + 2.)/2.6;
			float s = op * op *(3. - 2. * op);
			// Do the blue shift for scotopic vision simulation (night vision) [3]
			// The "night blue" is x,y(0.25, 0.25)
			x = (1. - s) * 0.25 + s * x;	// Add scotopic + photopic components
			y = (1. - s) * 0.25 + s * y;	// Add scotopic + photopic components
			// Take into account the scotopic luminance approximated by V [3] [4]
			float V = Y * (1.33 * (1. + y / x + x * (1. - x - y)) - 1.68);
			Y = 0.4468 * (1. - s) * V + s * Y;
		}

		// 2. Adapt the luminance value and scale it to fit in the RGB range [2]
		Y = applyTMAndGamma(Y);

		// Convert from xyY to XYZ
		highp vec3 XYZ = vec3(x * Y / y, Y, (1. - x - y) * Y / y);

		highp mat3 XYZ2RGB;
		if(doSRGB)
		{
			// Use the XYZ to sRGB matrix which uses a D65 reference white
			// Ref: http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
			XYZ2RGB = mat3(vec3( 3.2404542, -0.9692660,  0.0556434),
			               vec3(-1.5371385,  1.8760108, -0.2040259),
			               vec3(-0.4985314,  0.0415560,  1.0572252));
		}
		else
		{
		        // Use a XYZ to Adobe RGB (1998) matrix which uses a D65 reference white. Use values from same source:
			XYZ2RGB = mat3(vec3( 2.0413690, -0.9692660,  0.0134474),
			               vec3(-0.5649464, +1.8760108, -0.1183897),
			               vec3(-0.3446944, +0.0415560, +1.0154096));
		}

		color = XYZ2RGB * XYZ * brightnessScale;
	}

	return flagUseTmGamma ? color : pow(abs(color), vec3(oneOverGamma));
}

***
Error while compiling atmosphere vertex shader: ERROR: 0:2: '' : syntax error: #version directive must occur in a shader before anything else
ERROR: 0:2: '' : illegal order of preprocessor directives 

@alex-w alex-w added this to Needs triage in OpenGL/GLSL via automation Jun 7, 2024
@10110111
Copy link
Contributor

10110111 commented Jun 7, 2024

Try adding --opengl-compat after --low-graphics option.

@mene99
Copy link
Author

mene99 commented Jun 7, 2024

that seems to have fixed it

@gzotti
Copy link
Member

gzotti commented Jun 7, 2024

@10110111 are these options individual, or a kind of add-on where one makes only sense with the other? In the latter case we could add arguments to a --opengl-compat option (or rename to something new to avoid confusion), or at least just auto-activate the implied option.

@10110111
Copy link
Contributor

10110111 commented Jun 7, 2024

are these options individual, or a kind of add-on where one makes only sense with the other?

They are orthogonal. One undoes looking for Core profile, the other disables advanced features that may be (and often are) available in any profile.

@mene99
Copy link
Author

mene99 commented Jun 7, 2024

on the efficiency stand point I've noticed no FPS improvement in the usage tho. Not sure if the --low-graphics would directly benefit that, but low FPS has been my main issue since the newer versions were released.
Any input will be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Just a question, no change in code needed
Projects
OS: Windows
  
Needs triage
OpenGL/GLSL
  
Needs triage
Development

No branches or pull requests

4 participants