Plugin

class PluginTrueSkyRenderer : public simul::clouds::TrueSkyRenderer

A class that provides an interface between the trueSKY renderer and an external engine.

Public Functions

PluginTrueSkyRenderer()

Constructor.

virtual ~PluginTrueSkyRenderer()

Destructor.

virtual int RenderFrame(simul::crossplatform::GraphicsDeviceContext &deviceContext, simul::crossplatform::Texture *depthTexture, simul::crossplatform::Texture *colourTargetTexture, const simul::crossplatform::Viewport *depthViewport, const simul::crossplatform::Viewport *viewports, RenderStyle s, clouds::TrueSkyRenderMode trueSkyRenderMode, float exposure, float gamma, int framenumber)

Main render function.

virtual void InvalidateDeviceObjects()

Platform-dependent function called when uninitializing the plugin renderer.

virtual void RenderOverlays(simul::crossplatform::GraphicsDeviceContext &deviceContext, simul::crossplatform::Texture *depthTexture, bool clear_screen)

Render the debug textures.

virtual simul::clouds::Environment *GetEnvironment()

Returns the environment object.

void UpdateProfilingText(bool getSimpleProfiling = false)

Called once per frame, updates every 256 frames.

void GetCloudPointQuery(int id, const float *pos, VolumeQueryResult *res)

Fill in a query structure based on cloud properties at a position.

void CloudLineQuery(int id, const float *startpos, const float *endpos, LineQueryResult *res)

Fill in a query structure based on cloud properties from startpos to endpos.

void LightingQuery(int id, const float *pos, LightingQueryResult *res)

Fill in a structure with lighting values at the given position.

void CloudSphereInteraction(int id, const float *pos, const float *vel, float radius)

update a sphere that will push clouds aside.

void SetPointLight(int id, const float pos[3], float min_radius, float max_radius, const float irradiance[3])

For the next frame, put a light source at the specified position, with the specified irradiance. The radius specifies the size of the source.

void SetTexture(const char *name, ExternalTexture *t)

Setting texture properties.

void SetTexture(const char *name, void *tex, int w, int l, crossplatform::PixelFormat pixelFormat = crossplatform::PixelFormat::UNKNOWN, crossplatform::ResourceState resourceState = crossplatform::ResourceState::UNKNOWN)

Setting texture properties.

void SetCloudPlacementTexture(int id, void *texture, vec2 pos_km, vec2 ext_km)

A mask for cloud position.

void ProcessQueries(int num, Query *queries)

Called on the render thread, this will process queries from outside the plugin.

void Get(long long Enum, base::Variant *v)

Get a value corresponding to the given enum.

void Set(long long Enum, const base::Variant *v)

Set the value corresponding to the given enum.

void SetWater(long long Enum, int ID, const base::Variant *v)

Set the water value corresponding to the given enum.

float GetFloatAtPosition(FloatAtPosition f, const float *pos, int uid)

Property at a given position.

float GetFloatAtPosition(const char *name, const float *pos)

Property at a given position.

const char *GetString(const char *name, int *len)

Returns a string - name should be “ConstellationNames”, “HighlightConstellationNames”, “memory” or “profiling”.

void SetString(const char *name, const char *value)

Set a string value. name must be “LicenceKey”.

bool GetBool(const char *name) const

Returns a boolean value. See SetBool.

void SetBool(const char *name, bool value)

Set a boolean value. Valid names are: “ShowFades”, “ShowCelestialDisplay”, “ShowCompositing”, “ShowCloudCrossSections” , “Show2DCloudTextures”, “RenderSky”/”EnableRendering”, and “ReverseDepth”.

float GetFloat(const char *name) const

Returns a floating point value - see SetFloat.

void SetFloat(const char *name, float value)

Sets a floating point value. name should be “Time”, “Gamma”, “Exposure”, or “SimpleCloudShadowing”.

void SetMatrix4x4(const char *name, const float *matrix4x4)

Sets a matrix value.

bool HasFloat(const char *name) const

Does the named parameter exist?

bool HasInt(const char *name) const

Does the named parameter exist?

int GetInt(const char *name, int numparams, const base::Variant *params) const

Returns an integer value - see SetInt.

void SetInt(const char *name, int value, sky::uid layerID = 0)

Sets an integer value. name should be “CloudSteps”, or “Downscale”.

void GetExternalRenderValues(ExternalRenderValues *R)

Obtain the rendering values that should only be set once, or when explicity called.

void SetExternaDynamicValues(ExternalDynamicValues *D)

Values that can be changed per frame.

void GetExternalDynamicValues(ExternalDynamicValues *D)

Obtain the rendering values that should only be set once, or when explicity called.

bool TriggerAction(const char *name)

Trigger an action. name should be “RecompileShaders”.

sky::uid GetStormAtTime(float t) const

Get a storm ID, if it exists, at time t.

sky::uid GetStormByIndex(int i) const

Get a storm ID with index i.

int GetLightningBolts(simul::clouds::ExportLightningStrike *s, int maxnum) const

Get the properties of a lightning bolt that is currently active in the scene.

int GetNumStorms() const

Get the total number of storms.

sky::uid GetCloudKeyframerUIDByIndex(int index) const

Get the Cloud Layer UID by Index.

sky::uid GetInterpolatedCloudKeyframeUniqueId(int layer = 0) const

Get the ID of the current interpolated cloud keyframe on the given layer.

sky::uid GetInterpolatedSkyKeyframeUniqueId() const

Get the ID of the current interpolated sky keyframe.

bool KeyframeHasFloat(sky::uid uid, const char *name) const

Has the keyframe with the given ID got the given float value.

bool KeyframeHasInt(sky::uid uid, const char *name) const

Has the keyframe with the given ID got the given int value.

bool KeyframeHasBool(sky::uid uid, const char *name) const

Has the keyframe with the given ID got the given bool value.

void KeyframeSetBool(sky::uid uid, const char *name, bool value)

Set a bool value for a given keyframe.

bool KeyframeGetBool(sky::uid uid, const char *name) const

Fet a bool value for a given keyframe.

void KeyframeSetFloat(sky::uid uid, const char *name, float value)

Set a float value for a given keyframe.

float KeyframeGetFloat(sky::uid uid, const char *name) const

Get a bool value for a given keyframe.

void KeyframeSetInt(sky::uid uid, const char *name, int value)

Set a int value for a given keyframe.

int KeyframeGetInt(sky::uid uid, const char *name) const

Get a int value for a given keyframe.

void KeyframerSetFloat(sky::uid uid, const char *name, float value)

Set a float value for a given keyframer.

float KeyframerGetFloat(sky::uid uid, const char *name) const

Get a bool value for a given keyframer.

void KeyframerSetInt(sky::uid uid, const char *name, int value)

Set a int value for a given keyframer.

int KeyframerGetInt(sky::uid uid, const char *name) const

Get a int value for a given keyframer.

sky::uid CreateCloudKeyframer(const char *name)

Create a New Cloud Layer.

void DeleteCloudKeyframer(sky::uid uid)

Delete an existing Cloud Layer.

sky::uid InsertKeyframe(int layer, float time)

Insert a keyframe on a layer at time t.

int GetNumKeyframes(int layer) const

Get the number of keyframes on a given layer.

sky::uid GetKeyframeByIndex(int layer, int index) const

Get a cloud keyframe on a given layer by index.

void DeleteKeyframe(sky::uid uid)

Delete a keyframe with ID uid.

void ExportCloudLayer(const char *filenameUtf8)

Exports the cloud layer as geometry.

void KeyframerSetMapTexture(sky::uid uid, const char *PNGName)

Sets the Map Texture of the given layer.

void SetCloudKeyframePosition(sky::uid uid, math::Vector LatLongHeadingDeg)

Set Position of Cloud Keyframe.

bool CreateBoundedWaterObject(uint ID, math::Vector3 dimension, math::Vector3 location)

Create a bounded water object with a given ID.

bool CreateCustomWaterMesh(int ID, simul::terrain::WaterMeshObjectValues *newMesh)

Add a custom water mesh to a given bounded water object.

void UpdateCustomWaterMesh(int ID, simul::terrain::WaterMeshObjectValues *Mesh)

Update custom water mesh to a given bounded water object.

void RemoveCustomWaterMesh(int ID)

Remove a custom water mesh from a given bounded water object.

void RemoveBoundedWaterObject(uint ID)

Remove a bounded water object with a given ID.

bool AddWaterProbe(simul::terrain::WaterProbeValues *values)

Create a bounded water object with a given ID.

void RemoveWaterProbe(int ID)

Remove a bounded water object with a given ID.

vec4 GetWaterProbeValues(int ID)

Get the results of a water probe.

void UpdateWaterProbeValues(simul::terrain::WaterProbeValues *values)

Update the properties of a water object.

bool AddWaterBuoyancyObject(simul::terrain::WaterMeshObjectValues *newObject)

Create a water buoyancy object with a given struct that holds an array of vertices.

void UpdateWaterBuoyancyObjectValues(simul::terrain::WaterMeshObjectValues *values)

Update the properties of a water buoyancy object.

float *GetWaterBuoyancyObjectResults(int ID)

Get the results of a water buoyancy object.

void RemoveWaterBuoyancyObject(int ID)

Remove a water buoyancy object.

bool AddWaterMaskObject(simul::terrain::waterMaskingObject *newObject)

Create a water masking object.

void UpdateWaterMaskObjectValues(simul::terrain::waterMaskingObject *values)

Update the values of a specific water buoyancy object.

void RemoveWaterMaskObject(int ID)

Remove a water masking object.

bool AddWaterParticleGenerator(const simul::terrain::particleGeneratorValues *newGenerator, const simul::terrain::particleGeneratorType newGeneratorType, ExternalTexture customPlaneTexture)

Create a particle generator.

void UpdateWaterParticleGeneratorValues(const simul::terrain::particleGeneratorValues *values, const simul::terrain::particleGeneratorType generatorType, ExternalTexture customPlaneTexture)

Update the values of a specific water particle generator.

void RemoveWaterParticleGenerator(int ID)

Remove a particle generator.

void SetWaterFloat(const char *name, int ID, float value)

Set a float for a specfic water object.

void SetWaterInt(const char *name, int ID, int value)

Set an int for a specfic water object.

void SetWaterBool(const char *name, int ID, bool value)

Set a bool for a specfic water object.

void SetWaterVector(const char *name, int ID, const float *value)

Set a vector for a specfic water object.

float GetWaterFloat(const char *name, uint ID) const

Get a float for a specfic water object.

int GetWaterInt(const char *name, uint ID) const

Get an int for a specfic water object.

bool GetWaterBool(const char *name, uint ID) const

Get a bool for a specfic water object.

bool GetWaterVector(const char *name, uint ID, vec3*) const

Get a vector for a specfic water object.

Public Static Functions

static long long GetEnum(const char *name)

Get the enum that corresponds to a given name. A return value of zero means the name was not found.

static long long GetWaterEnum(const char *name)

Get the Water enum that corresponds to a given name. A return value of zero means the name was not found.

struct Query

A query from outside the plugin.