Skip to content

Commit d672c3b

Browse files
committed
Added support for rotating normal maps
- Added Normal Map Angle parameter to support rotating normal maps. - Added light max id parameter to keep shader iterations in the WebGL2 variant as minimal as possible, giving minor performance improvements if not utilizing all 32 lights. These features shift all parameter IDs by 2, as such existing projects need to be adjusted. Updated example project to support 1.9.
1 parent a2bd7ac commit d672c3b

11 files changed

Lines changed: 1285 additions & 972 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Applying the effect to lots of individual normal map sprites can be costly. Cons
4040
- Up to 32 simultaneous RGB light sources per normal map.
4141
- Linear, quadratic or mixed light falloff.
4242
- Distance clamping for spot light effects.
43+
- Supports rotated normal maps.
4344
- Global ambient light (RGB).
4445

4546
## Credits

construct-addon/addon.json

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"supported-renderers": ["webgl","webgl2"],
55
"name": "NormalMap32",
66
"id": "normalmap32",
7-
"version": "1.8.1.0",
7+
"version": "1.9.0.0",
88
"author": "Everade",
99
"website": "https://www.construct.net/make-games/addons/898/normalmap32",
1010
"documentation": "https://www.construct.net/make-games/addons/898/normalmap32/documentation",
@@ -15,7 +15,6 @@
1515
"effect.fx",
1616
"effect.webgl2.fx"
1717
],
18-
1918
"category": "normal-mapping",
2019
"blends-background": true,
2120
"cross-sampling": false,
@@ -26,7 +25,6 @@
2625
"horizontal": 0,
2726
"vertical": 0
2827
},
29-
3028
"parameters": [
3129
{
3230
"id": "screen-x-resolution",
@@ -41,9 +39,21 @@
4139
"uniform": "screenYResolution"
4240
},
4341
{
44-
"id": "light-1-state-01",
42+
"id": "normal-angle",
4543
"type": "float",
4644
"initial-value": 0,
45+
"uniform": "normalAngle"
46+
},
47+
{
48+
"id": "light-max-id",
49+
"type": "float",
50+
"initial-value": 32.0,
51+
"uniform": "lightMaxID"
52+
},
53+
{
54+
"id": "light-1-state-01",
55+
"type": "float",
56+
"initial-value": 1,
4757
"uniform": "light1State"
4858
},
4959
{
@@ -3019,7 +3029,7 @@
30193029
{
30203030
"id": "light-32-state-01",
30213031
"type": "float",
3022-
"initial-value": 1,
3032+
"initial-value": 0,
30233033
"uniform": "light32State"
30243034
},
30253035
{
@@ -3061,7 +3071,7 @@
30613071
{
30623072
"id": "light-32-luminosity",
30633073
"type": "float",
3064-
"initial-value": 0,
3074+
"initial-value": 1,
30653075
"uniform": "light32Luminosity"
30663076
},
30673077
{
@@ -3085,32 +3095,32 @@
30853095
{
30863096
"id": "light-32-ambient-luminosity",
30873097
"type": "float",
3088-
"initial-value": 1,
3098+
"initial-value": 0,
30893099
"uniform": "light32AmbientLuminosity"
30903100
},
30913101
{
30923102
"id": "light-32-distance",
30933103
"type": "float",
3094-
"initial-value": 0,
3104+
"initial-value": 1000,
30953105
"uniform": "light32Distance"
30963106
},
30973107
{
30983108
"id": "light-32-falloffv1",
30993109
"type": "float",
3100-
"initial-value": 1,
3110+
"initial-value": 0.5,
31013111
"uniform": "light32Falloffv1"
31023112
},
31033113
{
31043114
"id": "light-32-falloffv2",
31053115
"type": "float",
3106-
"initial-value": 1,
3116+
"initial-value": 0,
31073117
"uniform": "light32Falloffv2"
31083118
},
31093119
{
31103120
"id": "light-32-falloffv3",
31113121
"type": "float",
3112-
"initial-value": 1,
3122+
"initial-value": 0.2,
31133123
"uniform": "light32Falloffv3"
31143124
}
31153125
]
3116-
}
3126+
}

0 commit comments

Comments
 (0)