file RED.h

Base RED header file. Required by all other RED include files. More...

Go to the source code of this file.

Namespaces:

namespaceRED

Enumerations:

enumRED_RC { RED_OK =  0x0000, RED_FAIL =  0x0001, RED_ALLOC_FAILURE =  0x0002, RED_WORKFLOW_ERROR =  0x0003, RED_INVALID_LICENSE =  0x0004, RED_ACCESS_DENIED =  0x0005, RED_BAD_PARAM =  0x0006, RED_INIT_FAILED =  0x0007, RED_DLL_NOT_FOUND =  0x0008, RED_FILE_NOT_FOUND =  0x0009, RED_FILE_DATA_ERROR =  0x000A, RED_MULTIPLE_NETWORK_ADAPTERS =  0x000B, RED_INTERRUPT =  0x000C, RED_FILE_WRITE_ERROR =  0x000D, RED_END_OF_STREAM =  0x000E, RED_BAD_ACCESS_MODE =  0x000F, RED_ENCRYPTED_FILE =  0x0010, RED_UNKNOWN_CHUNK =  0x0011, RED_X64_DATA_ERROR =  0x0012, RED_FILE_CLOSE_ERROR =  0x0013, RED_NO_CONNECTION_TO_LICENSE_SERVER =  0x0014, RED_ALL_LICENSES_IN_USE =  0x0015, RED_INVALID_CUSTOMER_ID =  0x0016, RED_TIME_OUT =  0x0017, RED_DRV_FAIL =  0x0100, RED_DRV_ALLOC_FAILURE =  0x0101, RED_DRV_UNSUPPORTED_GPU =  0x0102, RED_DRV_LIMITED_RAYTRACE =  0x0103, RED_DRV_CONTEXT_SHARING_NOT_ALLOWED =  0x0104, RED_DRV_HOST_ERROR =  0x0105, RED_DRV_INIT_FAILED =  0x0106, RED_DRV_NO_PIXEL_FORMAT =  0x0107, RED_DRV_NO_RAYTRACE =  0x0108, RED_DRV_INVALID_SOFT_BUFFER =  0x0109, RED_DRV_FRAMEBUFFER_CREATION_ERROR =  0x010A, RED_DRV_CONTEXT_SHARING_ERROR =  0x010B, RED_DRV_OGL_INVALID_ENUM =  0x010C, RED_DRV_OGL_INVALID_VALUE =  0x010D, RED_DRV_OGL_INVALID_OPERATION =  0x010E, RED_SCG_INVALID_CAMERA_AXIS =  0x0200, RED_SCG_NO_DATA_IN_SHAPE =  0x0201, RED_SCG_INVALID_AUTO_CUBE_IMAGE_SETUP =  0x0202, RED_SCG_INVALID_IMAGE_ADDRESS =  0x0203, RED_SCG_GEOMETRY_ERROR =  0x0204, RED_SCG_INVALID_FONT =  0x0205, RED_SCG_INVALID_MATERIAL =  0x0206, RED_SCG_UNKNOWN_SOFT_SHADER =  0x0207, RED_SCG_DEAD_MATERIAL_ADDRESS =  0x0208, RED_SCG_SOFT_SHADER_DESCRIPTION_ERROR =  0x0209, RED_SCG_INVALID_PORTAL_MESH =  0x020A, RED_SCG_MULTIPLE_BATCH_SHARING_ERROR =  0x020B, RED_SCG_NOT_A_NUMBER_VERTEX =  0x020C, RED_SCG_FONT_RENDER_MODE_CHANGE_ERROR =  0x020D, RED_SCG_READ_ONLY_IMAGE =  0x020E, RED_SCG_NO_ROOT_DESTRUCTION =  0x020F, RED_SCG_SHAPE_ALREADY_DESTROYED =  0x0210, RED_SCG_INCONSISTENT_SCENE_UNITS =  0x0211, RED_SCG_INVALID_SKIN_MESH_DATA =  0x0212, RED_WFLOW_NO_DRAW_STATE =  0x0300, RED_WFLOW_SOFT_TRACER_IS_DISABLED =  0x0301, RED_WFLOW_USE_SOFT_RAYTRACE =  0x0302, RED_WFLOW_NESTED_DRAW_CALL =  0x0303, RED_WFLOW_WINDOW_DESTRUCTION_ERROR =  0x0304, RED_WFLOW_INVALID_SAMPLER =  0x0305, RED_MAT_COMPILATION_FAILED =  0x0400, RED_MAT_UNKNOWN_VAR =  0x0401, RED_MAT_SOFT_SHADER_LOAD_ERROR =  0x0402, RED_MAT_SOFT_SHADER_UNSUPPORTED_VERSION =  0x0403, RED_IMAGE_UNSUPPORTED_EXTENSION =  0x0500, RED_IMAGE_UNSUPPORTED_FORMAT =  0x0501, RED_NET_LOG_FAIL =  0x0600, RED_NET_SEND_FAIL =  0x0601, RED_NET_PROCESSED =  0x0602, RED_NET_NOT_INITIALIZED =  0x0603, RED_NET_INVALID_PROTOCOL =  0x0604, RED_NET_INVALID_SOCKET =  0x0605, RED_NET_INVALID_CONNECTION =  0x0606, RED_NET_WEBSERVER_FAIL =  0x0607, RED_NET_SOCKET_FAIL =  0x0608, RED_NET_SOCKET_NOT_CONNECTED =  0x0609, RED_NET_SOCKET_CLOSED =  0x060a, RED_NET_CANT_RESOLVE_DESTINATION =  0x060b, RED_NET_CANT_CREATE_SOCKET =  0x060c, RED_EMBREE_UNSUPPORTED_CPU =  0x0700, RED_EMBREE_DLL_NOT_FOUND =  0x0701, RED_GI_CACHE_DOESNT_MATCH =  0x800, RED_GI_TOO_MANY_CACHES_SET =  0x801, RED_UNSUPPORTED_EXTENSION =  0x0900, RED_FBX_DLL_NOT_FOUND =  0x0901, RED_FBX_DLL_ERROR =  0x0902, RED_FBX_LOAD_ERROR =  0x0903, RED_FBX_SAVE_ERROR =  0x0904 }

Defines:

#define_WIN32_WINNT 0x0500
#defineRED_2PI (6.283185307179f)
#defineRED_4PI (12.566370614359f)
#defineRED_INVPI (0.318309886184f)
#defineRED_INVTOL (1e6f)
#defineRED_INVTOL2 (1e12f)
#defineRED_PI (3.141592653589f)
#defineRED_PI2 (1.570796326794f)
#defineRED_PI4 (0.785398163397f)
#defineRED_RC_NORETURN (exp, object, expression, info)
#defineRED_RC_NULLRETURN (exp, object, expression, info)
#defineRED_RC_RETURN (exp, object, expression, info)
#defineRED_RCA (exp)RED_RC_RETURN( exp, this, NULL, NULL )
#defineRED_RCF (exp)RED_RC_RETURN( exp, NULL, NULL, NULL )
#defineRED_RCI (exp, obj, info1, info2)RED_RC_RETURN( exp, obj, info1, info2 )
#defineRED_RCN (exp)RED_RC_NULLRETURN( exp, this, NULL, NULL )
#defineRED_RCNF (exp)RED_RC_NULLRETURN( exp, NULL, NULL, NULL )
#defineRED_RCNI (exp, obj, info1, info2)RED_RC_NULLRETURN( exp, obj, info1, info2 )
#defineRED_RCO (exp)RED_RC_NORETURN( exp, this, NULL, NULL )
#defineRED_RCOF (exp)RED_RC_NORETURN( exp, NULL, NULL, NULL )
#defineRED_SQRTOL (1e-3f)
#defineRED_TOL (1e-6f)
#defineRED_TOL2 (1e-12f)
#defineREDDllHandler HINSTANCE
#defineREDExp
#defineREDExpExclusive
#defineREDFullExp __declspec(dllimport)
#defineREDMODExp __declspec(dllimport)

Detailed description:

Base RED header file. Required by all other RED include files.

This file contains base symbols used everywhere in REDsdk: symbol exports, basic define statements, symbolic values, etc...Cross platform compilation must use the following defines:

Enumerations documentation

enum RED_RC

RED_RC is the enumeration for all return codes sent back by the REDsdk API. It's a long value.

Enumerator:

RED_OK

RED_OK is returned when the method/function correctly executed.

RED_FAIL

RED_FAIL is returned when the method / function did not execute properly. There's usually no way to continue the current workflow. Note that except for critical bugs (like memory write errors) the engine is still safe and it should be possible to clear REDsdk and / or save data.

RED_ALLOC_FAILURE

RED_ALLOC_FAILURE is returned when the system runs out of memory, and the RED requested memory allocation could not be performed. The engine may not be able to provide the requested service that implied the allocation. Note that the engine has committed no fault at the time a memory allocation failure has been found.

RED_WORKFLOW_ERROR

RED_WORKFLOW_ERROR is returned when a method or a function was called and should not have been called at that time. Refer to the product documentation to check the workflow that you have implemented.

RED_INVALID_LICENSE

RED_INVALID_LICENSE is returned when a license check has failed. A license check can fail for several reasons:

  • If the license has expired
  • If the license is invalid

RED_ACCESS_DENIED

RED_ACCESS_DENIED is returned when the access to the requested file of directory was not granted.

RED_BAD_PARAM

RED_BAD_PARAM is returned when the parameters given to a function were not correct.

RED_INIT_FAILED

RED_INIT_FAILED is returned when a RED call occurred and all the requested initializations for it were not properly made. Check that all prerequisites for the function to behave properly have been fulfilled.

RED_DLL_NOT_FOUND

RED_DLL_NOT_FOUND is returned when trying to access to a specific module in REDsdk. This can be an external library loaded for software shading needs, or a REDsdk specific library that is missing.

RED_FILE_NOT_FOUND

RED_FILE_NOT_FOUND is returned when access to a specific file or directory resource has failed because the resource could not be found from the specified absolute or relative path.

RED_FILE_DATA_ERROR

RED_FILE_DATA_ERROR is returned when the data read from a file did not comply to some expectations. An invalid read value for a field, a field type mismatch are kind of errors generating this return code.

RED_MULTIPLE_NETWORK_ADAPTERS

RED_MULTIPLE_NETWORK_ADAPTERS is returned when multiple network adapters are available to the licensing module and that no one has been selected to be used as primary.

RED_INTERRUPT

Indicates that a return following a rendering interruption request.

RED_FILE_WRITE_ERROR

Indicates that a file operation caused a write error.

RED_END_OF_STREAM

Indicates that the end of a stream has been prematurely reached while reading data from it.

RED_BAD_ACCESS_MODE

Indicates that a file operation is incompatible with the file's access mode. For example, the user try to read from a write only file.

RED_ENCRYPTED_FILE

Indicates that a file is encrypted and an attempt to read it without providing a encryption key has occurred.

RED_UNKNOWN_CHUNK

Indicates that an unknown chunk has been encountered while reading from a stream. See RED::IREDFile::SetUnknownChunkPolicy to define a policy for the management of unknown data in streams.

RED_X64_DATA_ERROR

Indicates that a 64-bit formatted data has been accessed in a 32-bit environment.

RED_FILE_CLOSE_ERROR

Indicates an error while trying to close a file on the operating system.

RED_NO_CONNECTION_TO_LICENSE_SERVER

Indicates that the application is ran in per-seat licensing mode and can't connect to the license server. This may be due to a network issue. Please check that your machine is connected to the Internet and everything is up and running.

RED_ALL_LICENSES_IN_USE

Indicates that the application is ran in per-seat licensing mode and successfully connects to the license server but no more license is available. You can either purchase additional licenses or close some of the running applications.

RED_INVALID_CUSTOMER_ID

Indicates that the application is ran in per-seat licensing mode and connects to the license server successfully, but the provided customer ID is invalid. Please, check that you entered the correct customer ID you recevied on purchase.

RED_TIME_OUT

Indicates that a time-limited process has left before ending due to time out.

RED_DRV_FAIL

This return code indicates an unknown error that has occurred in the graphic driver layer. Application may be unsafe after this code has been returned. You may consider switching to software rendering.

RED_DRV_ALLOC_FAILURE

RED_DRV_ALLOC_FAILURE is returned when the graphic board runs out of system memory, and the RED requested memory allocation could not be performed. The engine is still safe, but can't draw with the resource that could not be created. RED_DRV_ALLOC_FAILURE can also be returned with REDsdk running in full software mode, indicating that the system is out of CPU RAM and that the memory error has occurred in the software layer that mimics the behavior of the GPU.

RED_DRV_UNSUPPORTED_GPU

RED_DRV_UNSUPPORTED_GPU is returned at the first window creation when the found hardware GPU is not supported by the RED engine. Consequently, the engine can't perform any rendering operation with this option setup. This problem can be bypassed by turning the RED::OPTIONS_RAY_ENABLE_SOFT_TRACER to the full software rendering mode AND by using the RED::IWindow::FrameTracing workflow, to configure REDsdk for a CPU only image processing.

RED_DRV_LIMITED_RAYTRACE

RED_DRV_LIMITED_RAYTRACE is returned when ray-tracer options are enabled on a GPU that has no full GPU ray-tracer capabilities. Rendering fails in this case.

RED_DRV_CONTEXT_SHARING_NOT_ALLOWED

This code indicates that two or more windows that are using an external rendering context (see RED::WindowRenderInfo) are sharing it. This is a workflow that is not allowed within the engine: every window must own its proprietary rendering context.

RED_DRV_HOST_ERROR

This code indicates that OpenGL was in error at the startup of the RED::IWindow::RestoreHostState or at the startup of a window rendering method (RED::IWindow::FrameDrawing or superset methods). OpenGL errors must be solved before calling the method. Note that this return code may also be returned whenever a context setup method fails (wglMakeCurrent on windows glXMakeCurrent on Linux and CGLSetCurrentContext on MacOS) for any reason.

RED_DRV_INIT_FAILED

This return code indicates a driver initialization error. Please check that you have a valid OpenGL driver installed on the target computer and that the installed driver version matches the recommended version detailed in the GPU chipset reference.

RED_DRV_NO_PIXEL_FORMAT

The engine has tried to initialize a rendering buffer using attributes that are not supported in the current environment. Please check that the color quality of your environment is "true color" (32 bits) as this may be the cause for this error to be returned. Otherwise, please check that the hardware you're using is able to match the color format of the buffer you request. For example, RGB buffers are often not available whereas RGBA buffers are available.

RED_DRV_NO_RAYTRACE

RED_DRV_NO_RAYTRACE is returned when the GPU back end has no GPU ray- tracing capabilities at all. Rendering fails in this case.

RED_DRV_INVALID_SOFT_BUFFER

RED_DRV_INVALID_SOFT_BUFFER is returned when a window buffer can't be updated while REDsdk is running in pure software mode. This error arises most often if the RED::OPTIONS_RAY_ENABLE_SOFT_TRACER option value is turned on after the creation of the window that returns it.

RED_DRV_FRAMEBUFFER_CREATION_ERROR

RED_DRV_FRAMEBUFFER_CREATION_ERROR is returned if the creation of a FBO has failed in the OpenGL driver. FBO stands for the ARB_framebuffer_object OpenGL extension and is used for offscreen rendering in auxiliary VRLs.

RED_DRV_CONTEXT_SHARING_ERROR

This code indicates an internal engine error that has occurred while trying to share contexts on Windows platforms with wglShareLists. Refer to the RED::WindowRenderInfo class definition for all details on context sharing.

RED_DRV_OGL_INVALID_ENUM

This return code indicates an error in the OpenGL layer of the REDsdk OpenGL driver. An OpenGL call has received an invalid enumeration from REDsdk. Please report this error to the REDsdk development team.

RED_DRV_OGL_INVALID_VALUE

This return code indicates an error in the OpenGL layer of the REDsdk OpenGL driver. An OpenGL call was made using an incorrect value from REDsdk. Please report this error to the REDsdk development team.

RED_DRV_OGL_INVALID_OPERATION

This return code indicates an error in the OpenGL layer of the REDsdk OpenGL driver. An OpenGL call was made in an incorrect usage context from REDsdk. Please report this error to the REDsdk development team.

RED_SCG_INVALID_CAMERA_AXIS

This return code value is returned for all cameras that have an invalid axis system. The camera sight, top and right vectors must be perpendicular one to each other to define a correct camera transformation. The three camera vectors must also define a right handed axis system.

RED_SCG_NO_DATA_IN_SHAPE

This return code value is used whenever the engine detects shapes that must be rendered and that have no valid data to render. This can be the case for example in a CID_REDMeshShape object that has no vertices or no triangles. This can also be the case of a shape that has not been modified at all after its creation (a light for example, whose type and rendering parameters have not been specified). By design, the engine refuses to waste time and chooses to reject these data: they must be removed from the scene graph. Note that this does not apply to CID_REDTransformShape objects.

RED_SCG_INVALID_AUTO_CUBE_IMAGE_SETUP

This return code is sent back during a window rendering whenever a RED::IImageCube object has received an incorrect auto update setup.

RED_SCG_INVALID_IMAGE_ADDRESS

This return code is sent back by RED::IWindow::FrameDrawing whenever a shader of a given material is using an image address that is not valid. This usually corresponds to an image that has been deleted whereas it's still used for the rendering of a material. Note that this may arise even if the material is not used for the rendering of the frame that ends in error.

RED_SCG_GEOMETRY_ERROR

This return code is sent back by RED::IWindow::FrameDrawing if two geometries are rendered with the same material and are using different formats for the same geometrical channel. For example if a mesh is using colors encoded with 4 floating point values and another mesh is using colors encoded with 4 unsigned bytes, then the two objects should not be drawn with the same material. Two different materials should be used to draw these two geometries. The same applies for all channels in meshes, lines or point shapes, for both the number of components and for the format of these channels.

RED_SCG_INVALID_FONT

This return code is sent back by RED::IWindow::FrameDrawing upon a try to setup a RED::IFont object that is not entirely specified. The most common error arises if the type of the font is not set.

RED_SCG_INVALID_MATERIAL

This return code is sent back by RED::IWindow::FrameDrawing. It indicates that a given shader in a material has an incorrect setup for the rendering: it may miss a RED::RenderCode, a vertex program or a pixel program for instance.

RED_SCG_UNKNOWN_SOFT_SHADER

This return code is sent back by RED::IWindow::FrameDrawing. It indicates that the engine has found a shader program with a built-in tag (see RED::ShaderString::SoftShaderStart) that does not correspond to any known built-in program. Consequently, the shader can't be evaluated in software rendering mode.

RED_SCG_DEAD_MATERIAL_ADDRESS

This return code is sent back by RED::IWindow::FrameDrawing. It indicates that a shape object is using a material address (RED::IShape::SetMaterial) that is not valid. Either the address is not a material object address or the material was deleted, while still used by the shape. Note that the engine does not systematically detect all dead material addresses. It'll detect such incorrect use cases when shapes are added to scene graphs, and not if the material is deleted after the shape setup.

RED_SCG_SOFT_SHADER_DESCRIPTION_ERROR

This return code is sent back by RED::IWindow::FrameTracing or by RED::IWindow::FrameDrawing. It indicates that a material has an incorrect parameter description for the RED::HW_SOFT_TRACER target. This can be due for example to a missing vertex / pixel shader program or to a parameter bound to a wrong target.

RED_SCG_INVALID_PORTAL_MESH

This return code is sent back by RED::IWindow::FrameTracing when a skylight (RED::ISkylightShape) is set to use a portal shape whose geometry is not valid: it has no triangle with a surface greater than RED_TOL2. Consequently, the portal can't be sampled properly.

RED_SCG_MULTIPLE_BATCH_SHARING_ERROR

This return code is emitted by RED::IWindow::FrameDrawing when the same set of batch addresses have been shared twice or more using RED::IMaterial::AddBatchArrays.

RED_SCG_NOT_A_NUMBER_VERTEX

This return code is emitted by RED::IWindow::FrameDrawing or RED::IWindow::FrameTracing while one of the ray-tracers is active. It indicates that one mesh in the database has a vertex that has an invalid value (Not a Number). The engine can't process the scene any further due to this invalid vertex and must return.

RED_SCG_FONT_RENDER_MODE_CHANGE_ERROR

This return code is emitted by RED::ITextShape::SetFont if a font is assigned to a text shape and if the text has been setup already with a font that is using another render mode. A text shape will only use one type of font render mode for its whole life.

RED_SCG_READ_ONLY_IMAGE

This return code is emitted by all image methods that attempt to modify an image that is read-only. The most common workflow that return this code is when the application tries to modify a built-in VRL render image. See RED::IViewpointRenderList::SetRenderImage or RED::IViewpointRenderList::SetRenderDepthImage.

RED_SCG_NO_ROOT_DESTRUCTION

This return code is emitted by RED::Factory::DeleteInstance on an attempt to destroy the root shape of a camera scene graph. This operation is not authorized. REDsdk has performed the allocation of the shape, and it'll destroy it automatically. Therefore, this does not need to be performed by the calling application.

RED_SCG_SHAPE_ALREADY_DESTROYED

This return code is emitted by RED::Factory::DeleteInstance on an attempt to destroy a shape that has been already deleted in the same transaction. This generally arise on an attempt to destroy a shape that was a child of a scene graph transform that was also released before. Please refer to the Life cycle of REDsdk objects page for details on the hierarchical destruction mechanisms in REDsdk.

RED_SCG_INCONSISTENT_SCENE_UNITS

This return code is sent when two physical lights use different scene units conversion factor in the same data set.

RED_SCG_INVALID_SKIN_MESH_DATA

This return code is sent when incorrect vertex data format is used with the RED::IMeshShape::InitializeSkinning method. Skinning can be done only on vertex and normal channels with a size of 3+ and with a RED::MFT_FLOAT format.

RED_WFLOW_NO_DRAW_STATE

This return code is sent when a RED::IWindow::FrameDrawing call occurs for a window that has just been created and for which no transaction has been closed since it was created. The window is unable to render a past transaction that was closed before its creation. You must close a transaction after having created a window to be able to render the window's contents.

RED_WFLOW_SOFT_TRACER_IS_DISABLED

This return code is sent by a RED::IWindow::FrameTracing call if the soft tracer has not been enabled on the resource manager. To solve the issue, simply access the resource manager and activate the RED::OPTIONS_RAY_ENABLE_SOFT_TRACER option during a new transaction. This will activate all the necessary engine setup for software rendering needs.

RED_WFLOW_USE_SOFT_RAYTRACE

RED_WFLOW_USE_SOFT_RAYTRACE is returned if a call to RED::IWindow::FrameDrawing has occurred whereas RED::IWindow::FrameTracing should have been called instead. This arises if the engine runs in full CPU software mode and a call to the GPU frame drawing method has occurred. This is not possible: all rendered images are created using the software tracer in this case and RED::IWindow::FrameTracing is the only method to create such images.

RED_WFLOW_NESTED_DRAW_CALL

RED_WFLOW_NESTED_DRAW_CALL is returned if a call to RED::IWindow::FrameDrawing or RED::IWindow::FrameTracing has occurred while a RED::IWindow::FrameTracingGICache was being processed. This a situation where the computer resources are used to generate an irradiance cache and no other rendering calls can occur while it's not finished. This situation often arise if the progress indicator callback tries to refresh a view.

RED_WFLOW_WINDOW_DESTRUCTION_ERROR

RED_WFLOW_WINDOW_DESTRUCTION_ERROR is returned by a call to RED::Factory::DeleteInstance on the destruction of a window. The REDsdk window must be released before the operating system window it's drawn into, in order to be able to proceed to some OpenGL cleanup tasks. If this code is returned, then the REDsdk window is not released, and remains alive in the cluster. Please node that this code can't be returned for a window that is using external OpenGL contexts, and that the behavior is identical even if REDsdk is running in pure software mode.

RED_WFLOW_INVALID_SAMPLER

RED_WFLOW_INVALID_SAMPLER is returned by RED::IWindow::FrameTracing if the sampler specified by RED::OPTIONS_SAMPLER is not compatible with the adaptive sampling threshold defined by the RED::OPTIONS_RAY_ADAPTIVE_SAMPLING_THRESHOLD. Adaptive sampling requires specific samplers to be setup in REDsdk. See the RED::OPTIONS_SAMPLER documentation for details.

RED_MAT_COMPILATION_FAILED

This return code is sent when a RED::MaterialController fails compiling the script of one of its properties. It means that there is at least one fatal error in the script's source code. Please, refer to the script language documentation here: The material controller scripting language to get a full description of the syntax.

RED_MAT_UNKNOWN_VAR

This return code is sent when an unknown variable or a variable with a wrong type or a wrong language constant is encountered in a material controller property script. To get the full list of pre-defined language constants, refer to the Material controller scripting language reference section.

RED_MAT_SOFT_SHADER_LOAD_ERROR

This return code is sent when the rendering of the current frame tries to access a software shading function for a material of the REDsdk material library and can't succeed. Check that you have the REDsdk material library accessible in the application path.

RED_MAT_SOFT_SHADER_UNSUPPORTED_VERSION

This return code is sent when a soft shader implementation is called for a version of the shader that is not supported. It permits to avoid binary inconsistence between REDsdk versions and shaders DLLs.

RED_IMAGE_UNSUPPORTED_EXTENSION

This return code is sent when an unsupported image file extension is used with one of the image I/O methods.

RED_IMAGE_UNSUPPORTED_FORMAT

This return code is sent when the provided image pixel format is not compatible with the requested image file format.

RED_NET_LOG_FAIL

RED_NET_LOG_FAIL is returned when the logging system tries to log to an invalid file, i.e the file can't be accessed or created.

RED_NET_SEND_FAIL

RED_NET_SEND_FAIL is returned when data have not been correctly sent through the network.

RED_NET_PROCESSED

RED_NET_PROCESSED is returned by a user callback when it successfully processed the corresponding request. Otherwise, the user callback must return RED_OK (if no error occured) to let RNET process the request on its own.

RED_NET_NOT_INITIALIZED

RED_NET_NOT_INITIALIZED is returned when a call to the REDnet API is made without having previously called RNET::System::Initialize.

RED_NET_INVALID_PROTOCOL

RED_NET_INVALID_PROTOCOL is returned when an invalid (or unsupported) protocol value is used with the REDnet API. Try using another RED::PROTOCOL value instead.

RED_NET_INVALID_SOCKET

RED_NET_INVALID_SOCKET is returned when an invalid socket is used through the API. An invalid socket is a socket which has not been fully initialized or a socket set with a wrong protocol for the call.

RED_NET_INVALID_CONNECTION

RED_NET_INVALID_CONNECTION is returned when an invalid connection is used with the REDnet API. A connection is invalid if it has never been set or has been closed before the call.

RED_NET_WEBSERVER_FAIL

RED_NET_WEBSERVER_FAIL is returned when a peer failed to start in web server mode.

RED_NET_SOCKET_FAIL

RED_NET_SOCKET_FAIL is returned when a low-level socket operation has failed. Most of the times it can be considered as not fatal as it often results from a disconnected peer or a network issue. To get more detailed information about a network error, set the custom network error on the peer using RED::IPeer::SetOnNetworkError.

RED_NET_SOCKET_NOT_CONNECTED

RED_NET_SOCKET_NOT_CONNECTED is returned when a valid connection-based socket is used to receive or send sata without having established any connection beforehand. It may result from an invalid destination address.

RED_NET_SOCKET_CLOSED

RED_NET_SOCKET_CLOSED is returned when a socket has been closed by the distant peer. This is not a fatal error, but the socket must be immediatly closed on the application side.

RED_NET_CANT_RESOLVE_DESTINATION

RED_NET_CANT_RESOLVE_DESTINATION is returned when a destination address can't be resolved and therefore REDnet can't connect to it. It may be due to an invalid address, port or service.

RED_NET_CANT_CREATE_SOCKET

RED_NET_CANT_CREATE_SOCKET is returned when the creation of a socket fails. It's safe to consider this message as a warning (most of the time, there's no network connection available) and to try again with socket creation later on.

RED_EMBREE_UNSUPPORTED_CPU

RED_EMBREE_UNSUPPORTED_CPU is returned when the 'use Embree' option (RED::OPTIONS_RAY_USE_EMBREE) is turned on and an unsupported CPU is used or there are missing methods in the Embree DLL that was loaded. To process your data, you first need to turn the 'use Embree' option off.

RED_EMBREE_DLL_NOT_FOUND

RED_EMBREE_DLL_NOT_FOUND is returned when an attempt to render a scene using Embree was made, but REDsdk could neither locate nor load the Embree library. Please check the existence of this library in the application library search path, and please check that the used operating system features all the necessary functions to enable Embree, or disable the 'use Embree' option (RED::OPTIONS_RAY_USE_EMBREE).

RED_GI_CACHE_DOESNT_MATCH

This return code is sent when an external GI cache is used to render a scene which doesn't match the original cache lighting configuration (there are differences in light settings between the two). This can be sent only if the RED::OPTIONS_RAY_GI_FOR_LIGHTING option is set to true.

RED_GI_TOO_MANY_CACHES_SET

This return code is sent when several external caches have been set through a call to RED::IViewpointRenderList::SetGICaches followed by a call to RED::IWindow::FrameTracingGICache. The engine can't proceed as it doesn't know which of the supplied GI caches must be updated.

The correct usage is to set a single GI cache before calling RED::IWindow::FrameTracingGICache.

RED_UNSUPPORTED_EXTENSION

This return code is sent when an unsupported file extension is used with one of the I/O methods.

RED_FBX_DLL_NOT_FOUND

RED_FBX_DLL_NOT_FOUND is returned when REDsdk could not locate the REDFbx library. Please check the existence of this library in the application library search path.

RED_FBX_DLL_ERROR

RED_FBX_DLL_ERROR is returned when REDsdk could not load the REDFbx library properly. Please check that the REDFbx library is up-to-date and not corrupted.

RED_FBX_LOAD_ERROR

RED_FBX_LOAD_ERROR is returned when the FBX library could not load the external file correctly.

RED_FBX_SAVE_ERROR

RED_FBX_SAVE_ERROR is returned when the FBX library could not save the DAG correctly.

Defines documentation

#define _WIN32_WINNT 0x0500
#define RED_2PI (6.283185307179f)

2*PI constant value to use in all RED computations.

#define RED_4PI (12.566370614359f)

4*PI constant value to use in all RED computations.

#define RED_INVPI (0.318309886184f)

1/PI constant value to use in all RED computations.

#define RED_INVTOL (1e6f)

The inverse value of the RED_TOL numerical tolerance.

#define RED_INVTOL2 (1e12f)

The square value of RED_INVTOL big value limit.

#define RED_PI (3.141592653589f)

PI constant value to use in all RED computations.

#define RED_PI2 (1.570796326794f)

PI/2 constant value to use in all RED computations.

#define RED_PI4 (0.785398163397f)

PI/4 constant value to use in all RED computations.

#define RED_RC_NORETURN(exp,
object,
expression,
info
)

Tests the result of an expression 'exp' and returns. Uses 'rc'.

Value:

{\
  rc = exp;\
  if( rc != RED_OK )\
  {\
    if( rc != RED_INTERRUPT )\
    {\
      RED::REDBreak( rc, __FUNCTION__, object, expression, info );\
    }\
    \
    return;\
  }\
}
#define RED_RC_NULLRETURN(exp,
object,
expression,
info
)

Tests the result of an expression 'exp' and returns NULL in case of error.

Value:

{\
  RED_RC red_rc_nullreturn = exp;\
  if( red_rc_nullreturn != RED_OK )\
  {\
    if( red_rc_nullreturn != RED_INTERRUPT )\
    {\
      RED::REDBreak( red_rc_nullreturn, __FUNCTION__, object, expression, info );\
    }\
    \
    return NULL;\
  }\
}
#define RED_RC_RETURN(exp,
object,
expression,
info
)

Tests the result of an expression 'exp' and return a RED_RC value.

Value:

{\
  RED_RC red_rc_return = exp;\
  if( red_rc_return != RED_OK )\
  {\
    if( red_rc_return != RED_INTERRUPT )\
    {\
      RED::REDBreak( red_rc_return, __FUNCTION__, object, expression, info );\
    }\
    \
    return red_rc_return;\
  }\
}
#define RED_RCA(exp) RED_RC_RETURN( exp, this, NULL, NULL )
#define RED_RCF(exp) RED_RC_RETURN( exp, NULL, NULL, NULL )
#define RED_RCI(exp,
obj,
info1,
info2
)RED_RC_RETURN( exp, obj, info1, info2 )
#define RED_RCN(exp) RED_RC_NULLRETURN( exp, this, NULL, NULL )
#define RED_RCNF(exp) RED_RC_NULLRETURN( exp, NULL, NULL, NULL )
#define RED_RCNI(exp,
obj,
info1,
info2
)RED_RC_NULLRETURN( exp, obj, info1, info2 )
#define RED_RCO(exp) RED_RC_NORETURN( exp, this, NULL, NULL )
#define RED_RCOF(exp) RED_RC_NORETURN( exp, NULL, NULL, NULL )
#define RED_SQRTOL (1e-3f)

The square root of the RED_TOL numerical tolerance.

#define RED_TOL (1e-6f)

Numerical tolerance for all RED mathematical calculations.

#define RED_TOL2 (1e-12f)

The square value of the RED_TOL numerical tolerance.

#define REDDllHandler HINSTANCE

Type encapsulating differences between Unix and windows dll pointers.

#define REDExp

REDsdk internal: exports a symbol for REDsdk.

Exports a symbol for a template class outside of REDsdk.

#define REDFullExp __declspec(dllimport)

Exports a symbol outside of REDsdk.

#define REDMODExp __declspec(dllimport)

Exports a symbol for a REDsdk module outside of it. Should be used with the _RED_MODULE pre-processor directive.