Features and feature
#1
Apost 
Hello,

Couple days ago I found murl engine, downloaded, compiled samples and I was impressed by your work. But I didn't find enough information to start (nor documents nor samples), so I would like to ask here. Please excuse my english - I'm not native speaker.

1. My main requirement - everything should be done programmatically in real time (I don't need XML or any other resource files). All data (vertexes, shaders, textures will be generated on the fly). I found AddGraphNode/RemoveGraphNode and some set... functions, but I wonder do you have set... and add.../remove... functions for everything ? How about import my own format, can I make C++ plugin by extension of your interface ?

2. My main projects area is visualisation, so I need 3D/Text/Video composition/deformation/lighting/postprocessing. For some projects I need middle rendering quality, but for some featured projects I will need AAA rendering quality and good physics (fluids, destructible objects, dynamic volumetric lights/shadows). Do you have in plans this features and when ?

The best answer would be 1 simple project with run-time created dynamic scene with water or glass objects and high quality render.

Right now I'm trying to use Esenthel engine, but it doesn't have good text to texture output (which is vitiable for me) and no scripting (only C++).
Also I tried to utilise G3D engine - it has photon mapping renderer, but community is not active and iOS & Android are not supported.

Also it would be good if you will publish your vision of engine and detailed roadmap.
Reply
#2
Apost 
Hi!

Quote:Couple days ago I found murl engine, downloaded, compiled samples and I was impressed by your work.
Thanks for the compliment!

Quote:But I didn't find enough information to start (nor documents nor samples), so I would like to ask here.
Currently, the documentation is still in a very early stage. We are working hard to improve on this during the Beta phase, however it will still take some time until we have a reasonable set of guides, tutorials and samples to get fully acquainted with all aspects of the engine. In the meantime we must ask you to be patient, nevertheless this forum is always a good place for any questions you may have.

Quote:Please excuse my english - I'm not native speaker.
No problem, neither am I. Wink

Quote:1. My main requirement - everything should be done programmatically in real time (I don't need XML or any other resource files). All data (vertexes, shaders, textures will be generated on the fly). I found AddGraphNode/RemoveGraphNode and some set... functions, but I wonder do you have set... and add.../remove... functions for everything ?
By design, the Murl Engine allows to do this for any type of entity you need, such as resources, scene graph nodes etc. It is possible to manage your scene description completely from C++ code and dynamically create/update your vertex and index buffers as well as textures with custom data.

On-the-fly shader creation is basically also possible on all currently supported platforms. However, when you also consider deploying your application on the upcoming Windows RT / Windows Phone 8 platform using DirectX 11 Mobile, you might run into trouble, as Dx11 does not allow runtime shader compilation (at least not for applications submitted to the Windows Store).

Quote:How about import my own format,
I assume you are talking about your own 3D file format. This is possible, as you can always load/parse your input data and feed the data to a GenericGeometry node.

Quote:can I make C++ plugin by extension of your interface ?
I'm not quite sure what you mean by that, could you please explain this question in more detail?

Quote:2. My main projects area is visualisation, so I need 3D/Text/Video composition/deformation/lighting/postprocessing. For some projects I need middle rendering quality, but for some featured projects I will need AAA rendering quality and good physics (fluids, destructible objects, dynamic volumetric lights/shadows). Do you have in plans this features and when ?
The built-in rigid body physics engine only supports a very basic set of features. If you need fluid and destructible object simulation, you will have to do it yourself or consider using an additional physics engine capable of doing so, as an additional component linked to your Murl Engine project.

Dynamic volumetric lights & shadows are already part of the Murl Engine.

Quote:The best answer would be 1 simple project with run-time created dynamic scene with water or glass objects and high quality render.
If you give us some time, we will provide you with a number of samples. This will take a few days however, but we will try to demonstrate all the features you need.

Quote:Right now I'm trying to use Esenthel engine, but it doesn't have good text to texture output (which is vitiable for me) and no scripting (only C++).
Also I tried to utilise G3D engine - it has photon mapping renderer, but community is not active and iOS & Android are not supported.
Currently, the Murl Engine is also C++ only. We plan to offer scripting support in the future as an add-on component, but most likely not before 2014.
Rendering text to a texture is a central component of the engine, I'm sure it will suit your needs.

Quote:Also it would be good if you will publish your vision of engine and detailed roadmap.
We are working on that Wink

Thanks for your interest. Don't hesitate to ask if you have further questions.
Best regards,

Christopher
Reply
#3
Apost 
Thank you for fast and kind reply.

Quote:On-the-fly shader creation is basically also possible on all currently supported platforms. However, when you also consider deploying your application on the upcoming Windows RT / Windows Phone 8 platform using DirectX 11 Mobile, you might run into trouble, as Dx11 does not allow runtime shader compilation (at least not for applications submitted to the Windows Store).
Honestly I don't care about Windows mobile platforms. My main platforms are OSX, Windows and secondary platforms are iOS, Android. So if you could hint how to compile shader at runtime it would be good starting point.

Quote:
Quote:can I make C++ plugin by extension of your interface ?
I'm not quite sure what you mean by that, could you please explain this question in more detail?
Probably I could implement one or several your interfaces in my class and implement my own functionality (may be bullet physics could be embedded this way?)

Quote:Currently, the Murl Engine is also C++ only. We plan to offer scripting support in the future as an add-on component, but most likely not before 2014.
My main language is C++ and it will be. So your engine is perfect fit from this point of view. I guess engine scripting is not necessary for my project. May be later and may be only for logic.

I'm going to investigate engine API this holidays.

And I found one small bug/feature - I can't enter korean characters in SystemFont sample ( I'm not korean, just work there Smile )
Reply
#4
Apost 
Quote:Thank you for fast and kind reply.
You're welcome.

Quote:Honestly I don't care about Windows mobile platforms. My main platforms are OSX, Windows and secondary platforms are iOS, Android. So if you could hint how to compile shader at runtime it would be good starting point.
OK, so I will put some simple runtime shader creation using GLSL source code in the sample.

Quote:Probably I could implement one or several your interfaces in my class and implement my own functionality (may be bullet physics could be embedded this way?)
One of the main goals of the Murl engine is extensibility, so this should be possible. There are several ways of how to do so however, so please simply post to this forum when you have any detailed questions.

Quote:And I found one small bug/feature - I can't enter korean characters in SystemFont sample ( I'm not korean, just work there Smile )
Thanks for the report. We'll check on that.

In the meantime, stay tuned. I'll post an answer to this thread when I have some sample code ready.

Best regards,

Christopher
Reply
#5
Apost 
Hello,

I heard it's hot time - summer, so I kindly ask about possible 3d rendering and GLSL runtime creation samples Smile

Wish you every success!

(27 Jun 2013, 10:04)dizzy Wrote:
Quote:Thank you for fast and kind reply.
You're welcome.

Quote:Honestly I don't care about Windows mobile platforms. My main platforms are OSX, Windows and secondary platforms are iOS, Android. So if you could hint how to compile shader at runtime it would be good starting point.
OK, so I will put some simple runtime shader creation using GLSL source code in the sample.

Quote:Probably I could implement one or several your interfaces in my class and implement my own functionality (may be bullet physics could be embedded this way?)
One of the main goals of the Murl engine is extensibility, so this should be possible. There are several ways of how to do so however, so please simply post to this forum when you have any detailed questions.

Quote:And I found one small bug/feature - I can't enter korean characters in SystemFont sample ( I'm not korean, just work there Smile )
Thanks for the report. We'll check on that.

In the meantime, stay tuned. I'll post an answer to this thread when I have some sample code ready.

Best regards,

Christopher
Reply
#6
Apost 
Hi again,

sorry to keep you waiting, I didn't forget about the samples I promised!

We are currently preparing for GDC & Gamescom next week in Cologne, so we are a little bit in a crunch at the moment. As soon as this is over, I'll start creating some useful examples.

In the meantime, you might take a quick look at this forum thread, which deals a little bit with runtime node creation:
http://murlengine.com/forum/showthread.php?tid=42

Thanks & best regards,

Christopher

PS: I'm glad that the outside temperature has dropped from ~40°C to more habitable 25° now. My brain finally stopped boiling Wink
Reply
#7
Apost 
Hi!

Finally I managed to put together a small sample for dynamic content creation using the Murl Engine. Find attached a ZIP file containing the source code for the "dynamic_content" sample, together with project files for OSX & iOS (XCode), Win32 (VS2008 and VS2010) and Android (SDK/NDK environment). Note that this sample is GLSL only, so it won't run using GL ES 1.1 or DirectX.

Simply unpack the archive and make sure to move the "samples" folder in parallel to the "murl" and "tutorials" folders, so that your folder structure looks something like this:
SomeDirectory/
	murl/
		3rd_party/
		base/
		common/
	tutorials/
		chapter01/
		chapter02/
	samples/	
		dynamic_content/

Find the individual project files in samples/dynamic_content/project/...

All the "flesh" of the sample can be found in the "dynamic_content_logic.cpp" file, which contains some documentation about the necessary steps, together with the GLSL bump mapping shader inlined at the bottom of the file.

The "dynamic_content_app.cpp" file contains some setup & configuration code to manage the different targets, together with the actual creation of the logic class.

Hope this helps you get started, don't hesitate to ask if you have further questions.

Best regards,
Christopher


Attached Files
.zip   dynamic_content.zip (Size: 2.29 MB / Downloads: 8)
Reply
#8
Apost 
Thank you very much!

Sample is perfectly organised to understand.
Everything is clear except shader parameters binding and multiple programs.

1. Shader parameters (questions are inlined):
From vertex shader
// This part came probably from engine
// What uniform parameters does engine set ?
// How to change them from code ?
// Is it possible to add our own uniform parameters ?
// Is it possible to process multiple lights with vector of uLightPosition
uniform mat4 uModelMatrix;
uniform mat4 uCameraViewMatrix; uniform mat4 uCameraViewProjectionMatrix;
uniform vec4 uLightPosition[2];

//This part came from line 368-372
// geom->AddAttribute(...) API
attribute vec4 aPosition;
attribute vec3 aNormal;
attribute vec3 aBinormal;
attribute vec3 aTangent;
attribute vec2 aTexCoord0;

// Fragment shader
// From where this uniform parameters were set ?
// Why lighting uniforms are arrays of 2 while only first element was used ?
uniform lowp vec4 uLightColorAmbient[2];
uniform lowp vec4 uLightColorDiffuse[2];
uniform lowp vec4 uLightColorSpecular[2];
uniform highp vec4 uLightAttenuation[2];

// This part came from IFixedParameters line 311-315
uniform lowp vec4 uMaterialColorAmbient;
uniform lowp vec4 uMaterialColorDiffuse;
uniform lowp vec4 uMaterialColorSpecular;
uniform mediump float uMaterialShininess;

// This part came from 278, 284, 290 by SetUnit(...) API
uniform lowp sampler2D uTexture0; // Diffuse color
uniform lowp sampler2D uTexture1; // Normal map
uniform lowp sampler2D uTexture2; // Specular color

2. Multiple programs.
I understand in simple case engine uses IFixedProgram to render objects.
In our case we use IShaderProgram and SetNumberOfNodes(1), so only 1 program is used.
I wonder is it possible to attach several programs to material to execute one by one ? Or any other technique is available ?

Thank you.
Reply
#9
Apost 
Quote:// What uniform parameters does engine set ?
There is a number of predefined uniforms that are directly set by the engine, defined in the Murl::IEnums::UniformItem enumeration:
http://murlengine.com/api/en/class_murl_...3379d7f52e

When we have the shader tutorials ready, we will give an overview of the available names. In the mean time, the actual variable name for each of these enum values can be retrieved by calling the static method Murl::IEnums::GetUniformItemName(). Some of these items also have an alternative name (specifically the array types), which can be queried using Murl::IEnums::GetUniformItemAlternativeName(). Both methods return a const Char* pointer; querying the alternative name may return a null pointer.
You can also check the necessary data type for each item (Murl::IEnums::UniformType) by calling Murl::IEnums::GetUniformItemDataType().

Quote://This part came from line 368-372
// geom->AddAttribute(...) API
attribute vec4 aPosition;
attribute vec3 aNormal;
attribute vec3 aBinormal;
attribute vec3 aTangent;
attribute vec2 aTexCoord0;
Analogous to uniforms, there is also the Murl::IEnums::AttributeItem enum:
http://murlengine.com/api/en/class_murl_...334b27467c
together with the methods Murl::IEnums::GetAttributeItemName(), Murl::IEnums::GetAttributeItemAlternativeName() and Murl::IEnums::GetAttributeItemDataType().

Quote:// How to change them from code ?
// Is it possible to add our own uniform parameters ?
Most of the predefined variables cannot directly be set by the user, but there exist both the IEnums::UNIFORM_ITEM_CUSTOM and IEnums::ATTRIBUTE_ITEM_CUSTOM items, which can be used to specify your own variables from code, with whatever variable name you need.

To do so, you need to group your custom uniforms in a suitable way using Graph::IGenericParameterGroup nodes (Actually, as a side note, for OpenGL ES 2.0 the actual grouping does not matter. However, for DirectX 11 and OpenGL ES 3.0, groups should be defined in such a way that each of them encapsulates uniforms with the same or similar update frequency). You can add individual uniform variables to each group you create, with desired variable name and data type.

Next, you need to put all desired groups into one Graph::IGenericParameters node, which can then be activated with a Graph::IParametersState node just like a Graph::IFixedParameters node. Here's a short snipped of how to do so from code:
// Create container for our sub-graph
Graph::INode* container = root->CreateNode("Node");

// Create parameter groups and add individual uniforms
UInt32 byteOffset;

Graph::IGenericParameterGroup* waterTransGroup = dynamic_cast<Graph::IGenericParameterGroup*>(root->CreateNode("GenericParameterGroup"));
waterTransGroup->SetName("cbWaterTrans");
byteOffset = 0;
SInt32 bumpTransIndex0 = waterTransGroup->AddUniform("uBumpTranslation0", IEnums::UNIFORM_TYPE_FLOAT_VECTOR_4, byteOffset);
SInt32 bumpTransIndex1 = waterTransGroup->AddUniform("uBumpTranslation1", IEnums::UNIFORM_TYPE_FLOAT_VECTOR_4, byteOffset);
Graph::IFloatVector4Uniform* bumpTransParam0 = waterTransGroup->GetFloatVector4Uniform(bumpTransIndex0);
Graph::IFloatVector4Uniform* bumpTransParam1 = waterTransGroup->GetFloatVector4Uniform(bumpTransIndex1);
container->AddChild(waterTransGroup->GetNodeInterface());

Graph::IGenericParameterGroup* waterScaleGroup = dynamic_cast<Graph::IGenericParameterGroup*>(root->CreateNode("GenericParameterGroup"));
waterScaleGroup->SetName("cbWaterScale");
byteOffset = 0;
SInt32 bumpScaleIndex0 = waterScaleGroup->AddUniform("uBumpScale0", IEnums::UNIFORM_TYPE_FLOAT_VECTOR_4, byteOffset);
SInt32 bumpScaleIndex1 = waterScaleGroup->AddUniform("uBumpScale1", IEnums::UNIFORM_TYPE_FLOAT_VECTOR_4, byteOffset);
Graph::IFloatVector4Uniform* bumpScaleParam0 = waterScaleGroup->GetFloatVector4Uniform(bumpScaleIndex0);
Graph::IFloatVector4Uniform* bumpScaleParam1 = waterScaleGroup->GetFloatVector4Uniform(bumpScaleIndex1);
container->AddChild(waterScaleGroup->GetNodeInterface());

// Create a parameters node to hold the two groups
Graph::IGenericParameters* waterParams = dynamic_cast<Graph::IGenericParameters*>(root->CreateNode("GenericParameters"));
waterParams->GetGenericParameterGroupNodeTarget()->SetNumberOfNodes(2);
waterParams->GetGenericParameterGroupNodeTarget()->SetNode(waterTransGroup, 0);
waterParams->GetGenericParameterGroupNodeTarget()->SetNode(waterScaleGroup, 1);
container->AddChild(waterParams->GetNodeInterface());

// Create a state object to activate the parameters for subsequent rendering
Graph::IParametersState* waterState = dynamic_cast<Graph::IParametersState*>(root->CreateNode("ParametersState"));
waterState->GetParametersNodeTarget()->SetNumberOfNodes(1);
waterState->GetParametersNodeTarget()->SetNode(waterParams->GetParametersInterface(), 0);
container->AddChild(waterState->GetNodeInterface());

// Add & init the container
root->InitGraph(container, mWaterParamContainer.GetNode());

// Set some values
Float val[] = { 42.0f, 2.0f, 3.0f, 1.0f };
bumpTransParam0->SetValue(val);


And here's how to use these uniforms in the shader:
uniform highp mat4 uModelMatrix;
uniform highp mat4 uCameraViewMatrix;
uniform highp mat4 uCameraProjectionMatrix;
uniform highp mat4 uCameraViewProjectionMatrix;
uniform highp vec4 uCameraPosition;

uniform mediump vec4 uBumpTranslation0;
uniform mediump vec4 uBumpScale0;
uniform mediump vec4 uBumpTranslation1;
uniform mediump vec4 uBumpScale1;

attribute highp vec4 aPosition;

varying mediump vec3 vWaterToEye;
varying mediump float vWaterToEyeLength;
varying mediump vec2 vBumpCoord0;
varying mediump vec2 vBumpCoord1;

void main()
{
    highp vec4 worldPosition = (uModelMatrix * aPosition);
    gl_Position = uCameraViewProjectionMatrix * worldPosition;

    mediump vec2 texCoord = worldPosition.xz;

    vBumpCoord0 = texCoord.xy * uBumpScale0.xy;
    vBumpCoord0 += uBumpTranslation0.xy;

    vBumpCoord1 = texCoord.xy * uBumpScale1.xy;
    vBumpCoord1 += uBumpTranslation1.xy;

    highp vec4 camPos = uCameraPosition;

    vWaterToEye = camPos.xyz - worldPosition.xyz;
    vWaterToEyeLength = length(vWaterToEye);
}


As I mentioned above, only most of the predefined uniforms cannot be set directly. The exception to this rule are the "uMaterial*" uniforms, which are regularly set via Graph::IFixedParameters nodes. If you want to use these uniforms in your shader together with a Graph::IGenericParameters node, you must manually add a Graph::IGenericParameterGroup with name (not ID!) "cbMaterial", and add the "uMaterial*" variables to that group.

Quote:// Why lighting uniforms are arrays of 2 while only first element was used ?
In the sample, only 1 simultaneous light source is used, so this value might as well be set to 1.

Quote:// Is it possible to process multiple lights with vector of uLightPosition
Currently, 2 simultaneous light sources are supported. If you want more, you might use multi-pass rendering, which leads to your next question:

Quote:2. Multiple programs.
I understand in simple case engine uses IFixedProgram to render objects.
In our case we use IShaderProgram and SetNumberOfNodes(1), so only 1 program is used.
I wonder is it possible to attach several programs to material to execute one by one ? Or any other technique is available ?
Yes, this is possible, through the use of Graph::MultiMaterial, Graph::MultiParamerers, Graph::MultiTexture and Graph::MultiLight nodes. However, this is another big topic on its own. I'll try to create another sample that covers this, and post another answer when it's ready. Again, I have to ask you for a bit of patience, but I promise it won't take long this time Wink

Best regards,

Christopher
Reply
#10
Apost 
Thank you!
Perfect answer to begin study and test engine for my project.
I'm starting to feel flexibility of your engine.

Best wishes to you and your team.
Reply


Forum Jump:


Copyright © 2011-2017 Spraylight GmbH.