View Single Post
Old 26 March 2018, 10:30   #72
Dr.Venom
Registered User
 
Join Date: Jul 2008
Location: Netherlands
Posts: 485
Quote:
Originally Posted by Dr.Venom View Post
From what screenmode did you take that picture, low-res or high-res?

I think I may have found a clue.

I booted into Workbench and changed the native screenmode to PAL: Low Res (320x256), i.e. 1:1 pixel ratio. To my surprise the issue doesn't occur now: the pattern in the left and right part of the blue canvas is the same (like it should). See attached image.

This suggest the issue with custom shaders and scaling occurs when native field mode has a 2:1 pixel aspect ratio (like in workbench) , but not when the field aspect ratio is 1:1, like in games. (It also explains why both you, retro-nerd and me didn't see any issues with the filtered graphics in games, as those are all 1:1 pixel aspect ratio.)

Toni, does this provide a lead to dig into the code?
Toni, could you possibly make a custom build of WinUAE, purely for testing purposes, where you replace the null filter .fx shader in direct3d.cpp with the point-prescale.fx code from the shader attached in the post here (also copied below)?

I'm really wondering whether when this shader is hardcoded into the same path as the null filter (which has no issue in hires mode), whether the scaling issue in hires / 2:1 pixel mode with custom shaders / the point-prescale.fx is also resolved.


Code:
// Simple point upscaler
// License: Freeware

string name : NAME = "point";

float2 ps                       : TEXELSIZE;

float4x4 World                  : WORLD;
float4x4 View                   : VIEW;
float4x4 Projection             : PROJECTION;
float4x4 Worldview              : WORLDVIEW;               // world * view
float4x4 ViewProjection         : VIEWPROJECTION;          // view * projection
float4x4 WorldViewProjection    : WORLDVIEWPROJECTION;     // world * view * projection

string combineTechique          : COMBINETECHNIQUE = "POINT";

texture SourceTexture            : SOURCETEXTURE;

sampler    decal = sampler_state
{
    Texture      = (SourceTexture);
    MinFilter = POINT;
    MagFilter = POINT;
};


struct out_vertex {
    float4 position : POSITION;
    float4 color    : COLOR;
    float2 t0       : TEXCOORD0;
}; 
 

out_vertex  VS_VERTEX(float3 position : POSITION, float2 texCoord : TEXCOORD0 )
{ 
    out_vertex OUT = (out_vertex)0;

    OUT.position = mul(float4(position,1.0),WorldViewProjection);
    OUT.t0 = texCoord;
    return OUT;  
}



float4 PS_FRAGMENT (in out_vertex VAR) : COLOR
{    

    return tex2D(decal, VAR.t0);    
}



technique POINT
{
    pass P0
    {
        // shaders        
        VertexShader = compile vs_2_0 VS_VERTEX();
        PixelShader  = compile ps_2_0 PS_FRAGMENT(); 
    }  
}
Dr.Venom is offline  
 
Page generated in 0.04308 seconds with 10 queries