Back to the Vavoom Forum Archives


Forum

New crash when compiling shaders

Fri, 14 May 2010 12:54:55

Firebrand

I'm getting the following error when starting the game:
ERROR: Failed to compile shader glshaders/shadows_model_light.fs: Fragment shader failed to compile with the following errors:
ERROR: 0:24: error(#164) l-value required assign "Normal" (can't modify a varying)
ERROR: error(#273) 1 compilation errors.  No code generated
So I changed that file like this:
Index: shadows_model_light.fs
===================================================================
--- shadows_model_light.fs	(revision 4237)
+++ shadows_model_light.fs	(working copy)
@@ -15,22 +15,22 @@
 		discard;
 	}
 
-	float DistToLight = length(VertToLight);// * 100.0;
+	float DistToLight = length(VertToLight); //* 100.0;
 	if (DistToLight >= LightRadius)
 	{
 		discard;
 	}
 	vec3 Incoming = normalize(VertToLight);
-	Normal = normalize(Normal);
-	float Angle = dot(Incoming, Normal);
+	vec3 Norm = normalize(Normal);
+	float Angle = dot(Incoming, Norm);
 //	Angle = 0.5 + 0.5 * Angle;
-	//float Add = LightRadius - Dist;
+//	float Add = LightRadius - Dist;
 	float Add = LightRadius - DistToLight;
 	Add *= Angle;
-	//if (Add <= 0.0)
-	//{
-	//	discard;
-	//}
+//	if (Add <= 0.0)
+//	{
+//		discard;
+//	}
 	Add = clamp(Add / 255.0, 0.0, 1.0);
 
 	gl_FragColor = vec4(LightColour.r, LightColour.g, LightColour.b, Add);
Now the game starts, but I'm getting another crash, here's the output of debug.txt:
Log: - VOpenGLDrawer::DrawAliasModelLight
Log: - DrawModelLight
Log: - VAdvancedRenderLevel::DrawAliasModelLight
Log: - VAdvancedRenderLevel::DrawEntityModelLight
Log: - VAdvancedRenderLevel::RenderThingLight
Log: - VAdvancedRenderLevel::RenderMobjsLight
Log: - VAdvancedRenderLevel::RenderLightShadows
Log: - VAdvancedRenderLevel::RenderScene
Log: - VAdvancedRenderLevel::RenderPlayerView
Log: - R_RenderPlayerView
Log: - SCR_Update
Log: - Host_Frame
Log: Doing C_Shutdown
Log: Doing CL_Shutdown
Log: PLAYER left the game

Log: Doing SV_Shutdown
Log: Doing delete GNet
Log: Doing delete GInput
Log: Doing V_Shutdown
Log: Doing delete GAudio
Log: Doing T_Shutdown
Log: Doing Sys_Shutdown
Log: Doing delete GSoundManager
Log: Doing R_ShutdownTexture
Log: Doing R_ShutdownData
Log: Doing VCommand::Shutdown
Log: Doing VCvar::Shutdown
Log: Doing ShutdownMapInfo
Log: Doing FL_Shutdown
Log: Doing W_Shutdown
Log: Doing GLanguage.FreeData
Log: Doing ShutdownDecorate
Log: Doing VObject::StaticExit
Log: Doing VName::StaticExit
Uninitialised: Doing Z_Shutdown


ERROR: Segmentation Violation
I've tried to locate the error, but I didn't found it, I'll try to make a debug build later today.
Fri, 14 May 2010 14:26:09

Firebrand

It was a very small error, the index variable wasn't being initialized, I've already committed the fixes for both problems <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->. I must say that the changes are quite impressive, it looks really good, but performance isn't there yet... but I think we will find a way to improve the algorithm and make it a bit faster.

Back to the Vavoom Forum Archives