diff --git a/code/LWOMaterial.cpp b/code/LWOMaterial.cpp
index 55d0e23f1..b54c21c26 100644
--- a/code/LWOMaterial.cpp
+++ b/code/LWOMaterial.cpp
@@ -320,13 +320,10 @@ void LWOImporter::ConvertMaterial(const LWO::Surface& surf,aiMaterial* pcMat)
// opacity ... either additive or default-blended, please
if (0.0 != surf.mAdditiveTransparency) {
-
const int add = aiBlendMode_Additive;
pcMat->AddProperty(&surf.mAdditiveTransparency,1,AI_MATKEY_OPACITY);
pcMat->AddProperty(&add,1,AI_MATKEY_BLEND_FUNC);
- }
-
- else if (10e10f != surf.mTransparency) {
+ } else if (10e10f != surf.mTransparency) {
const int def = aiBlendMode_Default;
const float f = 1.0f-surf.mTransparency;
pcMat->AddProperty(&f,1,AI_MATKEY_OPACITY);
diff --git a/doc/dox.h b/doc/dox.h
index d63c8a806..910e77eae 100644
--- a/doc/dox.h
+++ b/doc/dox.h
@@ -1173,6 +1173,18 @@ float4 PimpMyPixel (float4 prev)
@endcode
+@section shdacc How to access shader-code from a texture (AI_MATKEY_GLOBAL_SHADERLANG and AI_MATKEY_SHADER_VERTEX, ...)
+
+You can get assigned shader sources by using the following material keys:
+
+
AI_MATKEY_GLOBAL_SHADERLANGTo get the used shader language.
+AI_MATKEY_SHADER_VERTEX Assigned vertex shader code stored as a string.
+AI_MATKEY_SHADER_FRAGMENT Assigned fragment shader code stored as a string.
+AI_MATKEY_SHADER_GEO Assigned geometry shader code stored as a string.
+AI_MATKEY_SHADER_TESSELATION Assigned tesselation shader code stored as a string.
+AI_MATKEY_SHADER_PRIMITIVE Assigned primitive shader code stored as a string.
+AI_MATKEY_SHADER_COMPUTE Assigned compute shader code stored as a string.
+
*/
diff --git a/include/assimp/material.h b/include/assimp/material.h
index 81b5fb05f..b882bbc72 100644
--- a/include/assimp/material.h
+++ b/include/assimp/material.h
@@ -198,8 +198,6 @@ enum aiTextureType
*/
aiTextureType_NONE = 0x0,
-
-
/** The texture is combined with the result of the diffuse
* lighting equation.
*/
@@ -278,7 +276,7 @@ enum aiTextureType
*
* A texture reference that does not match any of the definitions
* above is considered to be 'unknown'. It is still imported,
- * but is excluded from any further postprocessing.
+ * but is excluded from any further post-processing.
*/
aiTextureType_UNKNOWN = 0xC,
@@ -375,7 +373,7 @@ enum aiShadingMode
*/
enum aiTextureFlags
{
- /** The texture's color values have to be inverted (componentwise 1-n)
+ /** The texture's color values have to be inverted (component-wise 1-n)
*/
aiTextureFlags_Invert = 0x1,
@@ -914,6 +912,13 @@ extern "C" {
#define AI_MATKEY_COLOR_TRANSPARENT "$clr.transparent",0,0
#define AI_MATKEY_COLOR_REFLECTIVE "$clr.reflective",0,0
#define AI_MATKEY_GLOBAL_BACKGROUND_IMAGE "?bg.global",0,0
+#define AI_MATKEY_GLOBAL_SHADERLANG "?sh.lang",0,0
+#define AI_MATKEY_SHADER_VERTEX "?sh.vs",0,0
+#define AI_MATKEY_SHADER_FRAGMENT "?sh.fs",0,0
+#define AI_MATKEY_SHADER_GEO "?sh.gs",0,0
+#define AI_MATKEY_SHADER_TESSELATION "?sh.ts",0,0
+#define AI_MATKEY_SHADER_PRIMITIVE "?sh.ps",0,0
+#define AI_MATKEY_SHADER_COMPUTE "?sh.cs",0,0
// ---------------------------------------------------------------------------
// Pure key names for all texture-related properties
@@ -1457,8 +1462,6 @@ inline aiReturn aiGetMaterialInteger(const C_STRUCT aiMaterial* pMat,
#endif //!__cplusplus
-
-
// ---------------------------------------------------------------------------
/** @brief Retrieve a color value from the material property table
*