File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ static size_t pieCount = 0;
66
66
static size_t polyCount = 0 ;
67
67
static size_t drawCallsCount = 0 ;
68
68
static bool shadows = false ;
69
+ static bool shadowsHasBeenInit = false ;
69
70
static ShadowMode shadowMode = ShadowMode::Shadow_Mapping;
70
71
static gfx_api::gfxFloat lighting0[LIGHT_MAX][4 ];
71
72
static gfx_api::gfxFloat lightingDefault[LIGHT_MAX][4 ];
@@ -161,7 +162,7 @@ uint32_t pie_getShadowMapResolution()
161
162
162
163
bool pie_setShadowMode (ShadowMode mode)
163
164
{
164
- if (mode == shadowMode)
165
+ if (mode == shadowMode && shadowsHasBeenInit )
165
166
{
166
167
return true ;
167
168
}
@@ -179,6 +180,7 @@ bool pie_setShadowMode(ShadowMode mode)
179
180
}
180
181
shadowMode = mode;
181
182
refreshShadowShaders ();
183
+ shadowsHasBeenInit = true ;
182
184
return successfulChangeToInputMode;
183
185
}
184
186
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ bool pie_LoadShaders(uint32_t shadowFilterSize)
124
124
// note: actual loading of shaders now occurs in gfx_api
125
125
126
126
// initialize gfx context shadow constants (must happen after context is initialized)
127
+ ASSERT (gfx_api::context::isInitialized (), " gfx context isn't initialized?" );
127
128
auto shadowConstants = gfx_api::context::get ().getShadowConstants ();
128
129
shadowConstants.shadowFilterSize = shadowFilterSize;
129
130
gfx_api::context::get ().setShadowConstants (shadowConstants);
@@ -132,6 +133,10 @@ bool pie_LoadShaders(uint32_t shadowFilterSize)
132
133
{
133
134
pie_setShadowMode (ShadowMode::Fallback_Stencil_Shadows);
134
135
}
136
+ else
137
+ {
138
+ pie_setShadowMode (ShadowMode::Shadow_Mapping);
139
+ }
135
140
136
141
gfx_api::gfxUByte rect[] {
137
142
0 , 255 , 0 , 255 ,
You can’t perform that action at this time.
0 commit comments