altopk.blogg.se

Obs chroma key
Obs chroma key










obs chroma key

Return distance(chroma_key, yuvx.yz) // Take the distance scalar value of two vectors.įloat GetEdgeDetectionFilteredChromaDist(float3 rgb, float2 texCoord)įloat distVal = SampleTexture(-texCoord-pixel_size).rgb * kernel1 // Top leftĭistVal += SampleTexture(texCoord-pixel_size).rgb * kernel1 // Top centerĭistVal += SampleTexture(texCoord-float2(pixel_size.x, 0.0)).rgb * kernel1 // Top rightĭistVal += SampleTexture(texCoord-float2(pixel_size.x, -pixel_size.y)).rgb * kernel2 // Middle leftĭistVal += SampleTexture(texCoord-float2(0.0, pixel_size.y)).rgb * kernel2 // Current pixelĭistVal += SampleTexture(texCoord+float2(0.0, pixel_size.y)).rgb * kernel2 // Middle rightĭistVal += SampleTexture(texCoord+float2(pixel_size.x, -pixel_size.y)).rgb * kernel3 // Bottom leftĭistVal += SampleTexture(texCoord+float2(pixel_size.x, 0.0)).rgb * kernel3 // Bottom centerĭistVal += SampleTexture(texCoord+pixel_size).rgb * kernel3 // Bottom rightįloat4 ProcessChromaKey(float4 rgba, VertData v_in)įloat chromaDist = GetEdgeDetectionFilteredChromaDist(rgba.rgb, v_in.uv) //Edge detection filter function.įloat baseMask = chromaDist - similarity įloat fullMask = pow(saturate(baseMask / smoothness), 1.5) įloat spillVal = pow(saturate(baseMask / spill), 1.5) įloat desat = (rgba.r * 0.2126 + rgba.g * 0.7152 + rgba.b * 0.0722) Return float4(pow(rgba.rgb, float3(gamma, gamma, gamma)) * contrast + brightness, rgba.a) įloat4 yuvx = mul(float4(rgb.rgb, 1.0), yuv_mat) //rgb to yuv Vert_out.pos = mul(float4(v_in.pos.xyz, 1.0), ViewProj) Uniform float4x4 yuv_mat = įloat2 uv : TEXCOORD0 //Texture coordinates. The code show is as follows(Its programming language uses the HLSL or GLSL language): uniform float4x4 ViewProj Is it necessary to adjust the position to make the fullmask work (Figure 3)? On the contrary, the parameterized horizontal scroll bar have no effect. The second problem is that the filter has changed to other kernel. The first problem is that when the power point presentation is captured, the background is set to red (Figure 1), and then I can get the edge of the text with my own edge detection kernel, but the usual green(or blue) color will not show the effect (Figure 2)? (The OBS-studio resource uses a white background for the convenience of seeing the effect) I want to ask everyone here, I hope I can get some suggestions or answers. I have had a problem with the recent homemade obs-studio filter. I refer to the OBS Studio 20.1.0 documentation and chroma_key_filter.effect on github.












Obs chroma key