Closed LiuSky closed 1 year ago
What does dumping a bunch of code into an issue mean? Is this a feature, ie a pull request?
Okay, I'll make a push request
Sorry, after 3 days, I still don't know how to solve this shader problem @ToddLa
Describe the problem in words, not just dumping code.
What are you trying to do? What features do you want?
I'm sorry, I shouldn't have just posted the code on it. I see that the mame core library has a bgfx folder, which has a chains folder, and then there is an xbr-lv2-fast.json function under the xbr file, which can make the rendering screen without serrated. Specific address at https://github.com/mamedev/mame/blob/master/bgfx/chains/xbr/xbr-lv2-fast.json. @ToddLa
The effect was very clear, but I did not know how to do it, and then I went to look up some information and said that using FXAA
MAME4iOS does not use BGFX (or OpenGL) it has its own Metal only renderer.
So no BGFX or shader chains info is gonna apply.
The Shaders it does use are hard coded, a plug-in Shader system is being investigated
Thank you very much for your explanation
include
include "ShaderTypes.h"
using namespace metal;
constant float4 FXAA_CONSTANTS = {1.0/float4(128.0, 128.0, 128.0, 128.0), 8.0, 0.125, 0.25};
fragment float4 fxaa_fragment_shader(FxaaVertexIO in [[stage_in]], texture2d colorTexture [[texture(0)]])
{
float3 rgbNW = colorTexture.sample(colorTexture.sampler, in.texCoord + (float2(-1.0, -1.0) FXAA_CONSTANTS.zw)).rgb;
float3 rgbNE = colorTexture.sample(colorTexture.sampler, in.texCoord + (float2( 1.0, -1.0) FXAA_CONSTANTS.zw)).rgb;
float3 rgbSW = colorTexture.sample(colorTexture.sampler, in.texCoord + (float2(-1.0, 1.0) FXAA_CONSTANTS.zw)).rgb;
float3 rgbSE = colorTexture.sample(colorTexture.sampler, in.texCoord + (float2( 1.0, 1.0) FXAA_CONSTANTS.zw)).rgb;
float3 rgbM = colorTexture.sample(colorTexture.sampler, in.texCoord).rgb;
}