Natural Selection 2

Natural Selection 2

NS2 GunGame
Sytch 17 Mar, 2016 @ 3:07pm
Marines are almost totally invisible on Linux
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=647193426

Log is spammed with this:
Worker 08 : Error: Compilation errors in renderer/Deferred.hlsl 0(396) : error C1115: unable to find compatible overloaded function "clamp(vec3, float, vec3)" : #version 140 #pragma optionNV(fastmath on) #pragma optionNV(ifcvt none) #pragma optionNV(inline all) #pragma optionNV(strict on) #pragma optionNV(unroll all) vec3 matrix_row0(mat3 m, int i) { return vec3( m[0], m[1], m[2] ); }
vec4 matrix_row0(mat4 m, int i) { return vec4( m[0], m[1], m[2], m[3] ); }
void clip0(float x) { if (x < 0.0) ; }
void clip0(vec2 x) { if (any(lessThan(x, vec2(0.0, 0.0)))) ; }
void clip0(vec3 x) { if (any(lessThan(x, vec3(0.0, 0.0, 0.0)))) ; }
void clip0(vec4 x) { if (any(lessThan(x, vec4(0.0, 0.0, 0.0, 0.0)))) ; }
vec2 m_scalar_swizzle20(float x) { return vec2(x, x); }
ivec2 m_scalar_swizzle20(int x) { return ivec2(x, x); }
uvec2 m_scalar_swizzle20(uint x) { return uvec2(x, x); }
vec3 m_scalar_swizzle30(float x) { return vec3(x, x, x); }
ivec3 m_scalar_swizzle30(int x) { return ivec3(x, x, x); }
uvec3 m_scalar_swizzle30(uint x) { return uvec3(x, x, x); }
vec4 m_scalar_swizzle40(float x) { return vec4(x, x, x, x); }
ivec4 m_scalar_swizzle40(int x) { return ivec4(x, x, x, x); }
uvec4 m_scalar_swizzle40(uint x) { return uvec4(x, x, x, x); }
in vec3 POSITION;
in vec2 TEXCOORD0;
in vec3 NORMAL;
in vec3 BINORMAL;
in vec3 TANGENT;
in vec4 COLOR;
out vec4 frag_TEXCOORD0;
out vec2 frag_TEXCOORD1;
out vec3 frag_TEXCOORD2;
out vec3 frag_TEXCOORD3;
out vec3 frag_TEXCOORD4;
out vec3 frag_TEXCOORD5;
out vec4 frag_COLOR0;
out vec4 frag_TEXCOORD6;
layout (std140) uniform PassConstants {
vec2 imagePlaneSize;
vec2 rcpFrame;
vec4 rcpFrameOpt;
vec2 texelCenter;
float nearPlane;
float farPlane;
};
layout (std140) uniform SceneConstants {
mat4 cameraToScreenMatrix;
mat4 cameraToWorldMatrix;
mat4 worldToScreenMatrix;
mat4 worldToCameraMatrix;
vec3 wsCameraOrigin;
float time;
};
uniform sampler2D randomNormalTexture;
struct VS_DeferredPass_Input {
v[/code]
< >
Showing 1-6 of 6 comments
Sytch 17 Mar, 2016 @ 3:45pm 
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=647212191

There, I fixed it by removing all clamps from the shaders.
Before:
float3 tempModelColorBase = clamp( modelColorBase.rgb / modelColorMapTex.a, 0.0, 1.0 );
After:
float3 tempModelColorBase = modelColorBase.rgb / modelColorMapTex.a;

I have no idea whether anything breaks after that. The HLSL compiler doesn't infer types right for some reason and thinks that 1.0 is a vec3 value.
Sytch 17 Mar, 2016 @ 3:59pm 
Okay, a more correct way is not to remove clamp completely but cast the second and third params to float like this:
float3 tempModelColorBase = clamp( modelColorBase.rgb / modelColorMapTex.a, (float) 0, (float) 1 );

This way it works. Please fix for all shaders in the mod that contain clamp.
ZycaR  [developer] 28 Mar, 2016 @ 1:23pm 
I didn't saw your thread till today (I'm not used to workshop stuff but learning) .. I'm very sorry for inconvience and will work hard to fix it. Thank you very much for suggestion.
ZycaR  [developer] 28 Mar, 2016 @ 1:33pm 
should be fixed in GunGame 0.25 RC .. please feel free to check it, I have no linux but exact casting to float is used in all shaders where clamp is used. Looks like 1 != 1.0 in bitness for shaders same as most programming languages.
Last edited by ZycaR; 28 Mar, 2016 @ 1:34pm
Sytch 28 Mar, 2016 @ 2:30pm 
Thank you, will try it soon!
Sytch 24 Apr, 2016 @ 8:04am 
Well, almost a month has passed but today I tried GG with friends and indeed this bug is fixed, everyone is visible. Thanks again!
< >
Showing 1-6 of 6 comments
Per page: 1530 50