summaryrefslogtreecommitdiffstats
path: root/src/render/materialsystem
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-10-05 20:34:44 +0200
committerLiang Qi <liang.qi@qt.io>2017-10-05 20:47:59 +0200
commit8e67fb1f148b2f3c795d230faad7aee20389878a (patch)
tree34358c0ee9ab4816d20d58d84bdab20093b1d423 /src/render/materialsystem
parentba5bc93b95d28a28a72e60281f765a6f031129a5 (diff)
parentd4fb24c0871320667640f100b743f34f702db6cf (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: src/animation/backend/channelmapper_p.h Change-Id: I4e0f59c6648925ba45d30ccc2405524a9e901a0e
Diffstat (limited to 'src/render/materialsystem')
-rw-r--r--src/render/materialsystem/prototypes/default.json45
1 files changed, 44 insertions, 1 deletions
diff --git a/src/render/materialsystem/prototypes/default.json b/src/render/materialsystem/prototypes/default.json
index 429c435f4..9f16b0f53 100644
--- a/src/render/materialsystem/prototypes/default.json
+++ b/src/render/materialsystem/prototypes/default.json
@@ -107,7 +107,7 @@
"major": 2,
"minor": 0
},
- "substitution": "gl_fragColor = $fragColor;"
+ "substitution": "gl_FragColor = $fragColor;"
},
{
"format": {
@@ -377,6 +377,15 @@
"rules": [
{
"format": {
+ "api": "OpenGLES",
+ "major": 2,
+ "minor": 0
+ },
+ "substitution": "highp mat3 $matrix = calcWorldSpaceToTangentSpaceMatrix($worldNormal, $worldTangent);",
+ "headerSnippets": [ "#pragma include :/shaders/es2/coordinatesystems.inc" ]
+ },
+ {
+ "format": {
"api": "OpenGLCoreProfile",
"major": 3,
"minor": 0
@@ -386,6 +395,40 @@
}
]
},
+ "phongFunction": {
+ "inputs": [
+ "ambient",
+ "diffuse",
+ "specular",
+ "shininess",
+ "worldPosition",
+ "worldView",
+ "worldNormal"
+ ],
+ "outputs": [
+ "outputColor"
+ ],
+ "rules": [
+ {
+ "format": {
+ "api": "OpenGLES",
+ "major": 2,
+ "minor": 0
+ },
+ "substitution": "highp vec4 $outputColor = phongFunction($ambient, $diffuse, $specular, $shininess, $worldPosition, $worldView, $worldNormal);",
+ "headerSnippets": [ "#pragma include :/shaders/es2/phong.inc.frag" ]
+ },
+ {
+ "format": {
+ "api": "OpenGLCoreProfile",
+ "major": 3,
+ "minor": 0
+ },
+ "substitution": "vec4 $outputColor = phongFunction($ambient, $diffuse, $specular, $shininess, $worldPosition, $worldView, $worldNormal);",
+ "headerSnippets": [ "#pragma include :/shaders/gl3/phong.inc.frag" ]
+ }
+ ]
+ },
"metalRoughFunction": {
"inputs": [
"baseColor",