mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-09-01 02:11:58 -04:00
fix background color (#460)
* fix background color * reduce print about false problem * Update memory.c
This commit is contained in:
@@ -300,7 +300,14 @@ float4 PSMain(PSInput input, float4 screenSpace : SV_Position) : SV_TARGET {
|
||||
@end
|
||||
|
||||
@if(o_grayscale)
|
||||
float intensity = (texel.r + texel.g + texel.b) / 3.0;
|
||||
float p = float(0x19);
|
||||
float r = texel.r*float(0x55);
|
||||
float g = texel.g*float(0x4B);
|
||||
float b = texel.b*float(0x5F);
|
||||
float intensity = (r+g+b) / 256.0;
|
||||
intensity *= 255.0/256.0;
|
||||
intensity = pow(intensity, (p * 1.5 / 256.0) + 0.25);
|
||||
intensity *= 31.0/32.0;
|
||||
float3 new_texel = input.grayscale.rgb * intensity;
|
||||
texel.rgb = lerp(texel.rgb, new_texel, input.grayscale.a);
|
||||
@end
|
||||
|
||||
@@ -260,7 +260,14 @@ fragment float4 fragmentShader(ProjectedVertex in [[stage_in]], constant FrameUn
|
||||
@end
|
||||
|
||||
@if(o_grayscale)
|
||||
float intensity = (texel.x + texel.y + texel.z) / 3.0;
|
||||
float p = float(0x19);
|
||||
float r = texel.r*float(0x55);
|
||||
float g = texel.g*float(0x4B);
|
||||
float b = texel.b*float(0x5F);
|
||||
float intensity = (r+g+b) / 256.0;
|
||||
intensity *= 255.0/256.0;
|
||||
intensity = pow(intensity, (p * 1.5 / 256.0) + 0.25);
|
||||
intensity *= 31.0/32.0;
|
||||
float3 new_texel = in.grayscale.xyz * intensity;
|
||||
texel.xyz = mix(texel.xyz, new_texel, in.grayscale.w);
|
||||
@end
|
||||
|
||||
@@ -188,7 +188,14 @@ void main() {
|
||||
@end
|
||||
|
||||
@if(o_grayscale)
|
||||
float intensity = (texel.r + texel.g + texel.b) / 3.0;
|
||||
float p = float(0x19);
|
||||
float r = texel.r*float(0x55);
|
||||
float g = texel.g*float(0x4B);
|
||||
float b = texel.b*float(0x5F);
|
||||
float intensity = (r+g+b) / 256.0;
|
||||
intensity *= 255.0/256.0;
|
||||
intensity = pow(intensity, (p * 1.5 / 256.0) + 0.25);
|
||||
intensity *= 31.0/32.0;
|
||||
vec3 new_texel = vGrayscaleColor.rgb * intensity;
|
||||
texel.rgb = mix(texel.rgb, new_texel, vGrayscaleColor.a);
|
||||
@end
|
||||
|
||||
+1
-1
@@ -155,7 +155,7 @@ Gfx* segmented_gfx_to_virtual(const void* addr) {
|
||||
}
|
||||
|
||||
static uintptr_t get_texture2(size_t offset, const course_texture* textures) {
|
||||
if (!(offset & 0x5000000)) {
|
||||
if (!((offset >= 0x5000000) && (offset < 0x6000000))) {
|
||||
return NULL;
|
||||
}
|
||||
size_t totalOffset = 0x5000000;
|
||||
|
||||
Reference in New Issue
Block a user