v_sim.Gl¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
antialias line |
||
r/w |
background alpha channel |
||
r/w |
background blue channel |
||
r/w |
background green channel |
||
r/w |
background red channel |
||
r/w |
Fog is used |
||
r/w |
specific fog alpha channel |
||
r/w |
specific fog blue channel |
||
r/w |
Fog color is the bg color |
||
r/w |
depth where fog hides all |
||
r/w |
specific fog green channel |
||
r/w |
specific fog red channel |
||
r/w |
starting fog depth |
||
r |
light environment |
||
r/w |
global rendering mode |
||
r/w |
differenciate right and left buffer |
||
r/w |
angle between left and right buffers |
||
r/w |
draw in two passes to improve transparency |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Gets emitted when the OpenGL scene is dirty and requires a redraw. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
||
priv |
r |
Class Details¶
- class v_sim.Gl(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Common name to refer to a #_VisuGl.
- classmethod createColoredLineShader(withFog)¶
- Parameters:
withFog (
bool) – a boolean.- Raises:
- Returns:
Trueon success.- id:
a location for a GL id.
- locs:
an array to store possible uniform ids.
- Return type:
Create a GLSL program rendering lines which colours depend on the vertices. On success, the GL id for the program is stored in id. It will be sensitive to fog according to withFog.
New in version 3.9.
- classmethod createFlatShader(withFog)¶
- Parameters:
withFog (
bool) – a boolean.- Raises:
- Returns:
Trueon success.- id:
a location for a GL id.
- locs:
an array to store possible uniform ids.
- Return type:
Create a GLSL program rendering flat colours independant on the vertices. On success, the GL id for the program is stored in id. It will be sensitive to fog according to withFog.
New in version 3.9.
- classmethod createLineShader(withFog)¶
- Parameters:
withFog (
bool) – a boolean.- Raises:
- Returns:
Trueon success.- id:
a location for a GL id.
- locs:
an array to store possible uniform ids.
- Return type:
Create a GLSL program rendering lines with fixed colours. On success, the GL id for the program is stored in id. It will be sensitive to fog according to withFog.
New in version 3.9.
- classmethod createMaterialShader(withFog)¶
- Parameters:
withFog (
bool) – a boolean.- Raises:
- Returns:
Trueon success.- id:
a location for a GL id.
- locs:
an array to store possible uniform ids.
- Return type:
Create a GLSL program rendering surfaces with light effects. On success, the GL id for the program is stored in id. It will be sensitive to fog according to withFog.
New in version 3.9.
- classmethod createOrthoShader()¶
- Raises:
- Returns:
Trueon success.- id:
a location for a GL id.
- locs:
an array to store possible uniform ids.
- Return type:
Create a GLSL program rendering per vertex colours in the window coordinates. On success, the GL id for the program is stored in id.
New in version 3.9.
- classmethod createShader(vertexSource, fragmentSource)¶
- Parameters:
- Raises:
- Returns:
Trueon success.- id:
a location for a GL id.
- Return type:
Create a GLSL program using vertexSource and fragmentSource. On success, the GL id for the program is stored in id.
New in version 3.9.
- classmethod createSimpleShader(withFog)¶
- Parameters:
withFog (
bool) – a boolean.- Raises:
- Returns:
Trueon success.- id:
a location for a GL id.
- locs:
an array to store possible uniform ids.
- Return type:
Create a GLSL program rendering colours which depend on the vertices. On success, the GL id for the program is stored in id. It will be sensitive to fog according to withFog.
New in version 3.9.
- classmethod createTextShader(withFog)¶
- Parameters:
withFog (
bool) – a boolean.- Raises:
- Returns:
Trueon success.- id:
a location for a GL id.
- locs:
an array to store possible uniform ids.
- Return type:
Create a GLSL program rendering textures for text. On success, the GL id for the program is stored in id. It will be sensitive to fog according to withFog.
New in version 3.9.
- classmethod rendering_applyMode(mode)¶
- Parameters:
mode (
v_sim.GlRenderingMode) – an integer.
Change the rendering mode of current OpenGL context.
- classmethod rendering_getAllModeLabels()¶
-
This function retrieve al the names (translated) of available rendering modes.
- classmethod rendering_getAllModes()¶
-
This function retrieve al the names of available rendering modes.
- classmethod rendering_getModeFromName(name, id)¶
- Parameters:
name (
str) – a string ;id (
v_sim.GlRenderingMode) – a location to store the resulting id.
- Returns:
Trueif the name exists.- Return type:
This function retrieve the rendering mode id associated to the name.
- addHint(value)¶
-
Set some additional hints to self.
New in version 3.8.
- applyLights()¶
If self has some defined lights, it setup the OpenGL context with them and notify the “lights” parameter.
New in version 3.8.
- freeContext()¶
This method is called when an OpenGL surface is destroyed to free OpenGL resources.
New in version 3.9.
- getAntialias()¶
- Returns:
wether or not the antialising for lines is activated.
- Return type:
Get the value of the antialiasing parameter.
- getBgColor()¶
- Returns:
a storage for four values.
- Return type:
rgba: [
float]
Read the RGBA value of the specific background colour (in [0;1]).
New in version 3.8.
- getFogActive()¶
-
Read if fog is used or not.
New in version 3.8.
- getFogColor()¶
- Returns:
a storage for three values.
- Return type:
rgba: [
float]
Gives the actual fog color, for the specific color, use
v_sim.Gl.getFogSpecificColor().New in version 3.8.
- getFogFollowsBg()¶
- Returns:
Trueif the fog uses its own color orFalseif it uses the color of the background.- Return type:
Read if fog uses a specific colour or not.
New in version 3.8.
- getFogSpecificColor()¶
- Returns:
a storage for three values.
- Return type:
rgba: [
float]
Gives the specific fog color, for the actual color, use
v_sim.Gl.getFogColor().New in version 3.8.
- getFogStartFull()¶
- Returns:
two float location.
- Return type:
startFull: [
float]
Retrieves the starting and ending value (reduced) of fog extension.
New in version 3.8.
- getHint()¶
- Returns:
the mask of current hints.
- Return type:
Retrieve hints of self.
New in version 3.8.
- getLights()¶
- Returns:
the set of current lights.
- Return type:
V_Sim proposes a wrapper around the OpenGL light definitions.
- getMode()¶
- Returns:
the identifier of the current rendering option.
- Return type:
This function retrieve the value of the parameter renderingOption.
- getStereo()¶
- Returns:
Trueif the surface try to draw in stereo (may beTrue, even ifv_sim.Gl.getStereoCapability() returnsFalse, in that case the stereo capability is not used).- Return type:
Retrieve the status of the OpenGL surface.
- getStereoAngle()¶
- Returns:
the angle.
- Return type:
Retrieve the angle of the eyes in the stereo output.
- getStereoCapability()¶
-
Retrieve if the OpenGL window can render in stereo or not.
- getTrueTransparency()¶
-
The drawing can be done in one pass or two to respect transparency.
- initContext()¶
- Raises:
- Returns:
Falseon error.- Return type:
This method is called when an OpenGL surface is created for the first time. It sets basic OpenGL options and calls other OpenGLFunctions used in V_Sim.
- paint()¶
This method is called when it’s necessary to redraw.
- removeHint(value)¶
-
Remove an additional hints from self.
New in version 3.9.
- setAntialias(value)¶
- Parameters:
value (
bool) – a boolean to activate or not the lines antialias.- Returns:
Trueif value is actually changed.- Return type:
To set the antialiasing on lines.
- setBgColor(rgba, mask)¶
- Parameters:
rgba ([
float]) – a three floats array with values (0 <= values <= 1) for the red, the green and the blue color. Only values specified by the mask are really relevant.mask (
int) – usev_sim.COLOR_MASK_R,v_sim.COLOR_MASK_G,v_sim.COLOR_MASK_B,v_sim.COLOR_MASK_RGBAor a combinaison to indicate what values in the rgb array must be taken into account.
- Returns:
Trueif changed.- Return type:
Method used to change the value of the parameter background_color.
New in version 3.8.
- setFogActive(value)¶
-
Activates the fog rendering, or not.
New in version 3.8.
- setFogColor(rgba, mask)¶
- Parameters:
rgba ([
float]) – four [0;1] float values.mask (
int) – a mask, seev_sim.COLOR_MASK_Rfor instance.
- Returns:
Trueif value is actually changed.- Return type:
Change the fog specific colour. Activate it with
v_sim.Gl.setFogFollowsBg().New in version 3.8.
- setFogFollowsBg(value)¶
-
Specifies if the fog is coloured with the background colour or with its own colour, see
v_sim.Gl.setFogColor().New in version 3.8.
- setFogStartFull(startEnd, mask)¶
- Parameters:
startEnd ([
float]) – two [0;1] floating point values.mask (
int) – a mask, seev_sim.GL_FOG_MASK_STARTandv_sim.GL_FOG_MASK_FULL.
- Returns:
Trueif values are actually changed.- Return type:
Change the starting and ending point of fog.
New in version 3.8.
- setMode(value)¶
- Parameters:
value (
v_sim.GlRenderingMode) – an integer to represent the method of rendering.- Returns:
Trueif value is actually changed.- Return type:
This function change the value of the parameter renderingOption. It controls how V_Sim renders objects, in wireframe for example.
- setStereo(status)¶
-
Change the type of rendering. The surface can be switch to stereo, only if the OpenGL has stereo capabilities (see
v_sim.Gl.getStereoCapability()).
- setStereoAngle(angle)¶
- Parameters:
angle (
float) – a positive floating point value.- Returns:
Trueif redraw should be done.- Return type:
Change the angle of the eyes in the stereo output.
- setTrueTransparency(status)¶
-
If true the rendering is done twice to respect the transparency.
- do_draw() virtual¶
called to compute the object to be sent to the GPU.
- do_freeContext() virtual¶
This method is called when an OpenGL surface is destroyed to free OpenGL resources.
New in version 3.9.
- do_initContext() virtual¶
-
This method is called when an OpenGL surface is created for the first time. It sets basic OpenGL options and calls other OpenGLFunctions used in V_Sim.
- do_render() virtual¶
called to run drawing primitives on GPU.
Signal Details¶
Property Details¶
- v_sim.Gl.props.antialias¶
-
antialias line
- v_sim.Gl.props.bg_alpha¶
-
background alpha channel
- v_sim.Gl.props.bg_blue¶
-
background blue channel
- v_sim.Gl.props.bg_green¶
-
background green channel
- v_sim.Gl.props.bg_red¶
-
background red channel
- v_sim.Gl.props.fog_active¶
-
Fog is used
- v_sim.Gl.props.fog_alpha¶
-
specific fog alpha channel
- v_sim.Gl.props.fog_blue¶
-
specific fog blue channel
- v_sim.Gl.props.fog_follows_bg¶
-
Fog color is the bg color
- v_sim.Gl.props.fog_full¶
-
depth where fog hides all
- v_sim.Gl.props.fog_green¶
-
specific fog green channel
- v_sim.Gl.props.fog_red¶
-
specific fog red channel
- v_sim.Gl.props.fog_start¶
-
starting fog depth
- v_sim.Gl.props.lights¶
- Name:
lights- Type:
- Default Value:
- Flags:
light environment
- v_sim.Gl.props.mode¶
-
global rendering mode
- v_sim.Gl.props.stereo¶
-
differenciate right and left buffer
- v_sim.Gl.props.stereo_angle¶
-
angle between left and right buffers