• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 36 37 38 39 40 ... 116 Next »

Bilinear Shader
View New Posts | View Today's Posts

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Bilinear Shader
02-25-2015, 02:05 PM
#1
KrossX Offline
クロスエクス
**
Posts: 20
Threads: 2
Joined: Aug 2009
I dunno if it's a bug, but in D3D scaling seems to be filtered while not in OGL for me. So I made this simple shader to get filtered scaling in OGL.

Example:
native x1 - D3D, OGL, OGL + Shader
native x3 - D3D, OGL, OGL + Shader

Code:
void main()

{
float2 factor = uv0 * resolution.xy - float2(0.5);

const int2 coord = int2(factor);
const int2 dx = int2(1, 0);
const int2 dy = int2(0, 1);

float4 color  = texelFetch(samp9, int3(coord, 0), 0);
float4 color1 = texelFetch(samp9, int3(coord + dx, 0), 0);
float4 color2 = texelFetch(samp9, int3(coord + dy, 0), 0);
float4 color3 = texelFetch(samp9, int3(coord + dx + dy, 0), 0);

factor = fract(factor);

color = mix(mix(color, color1, factor.x), mix(color2, color3, factor.x), factor.y);

SetOutput(color);
}
[Image: EvQ2eUi.png]
Find
Reply
02-25-2015, 03:03 PM
#2
MayImilae Offline
Chronically Distracted
**********
Administrators
Posts: 4,568
Threads: 119
Joined: Mar 2011
You can used force texture filtering for that...
[Image: RPvlSEt.png]
AMD Threadripper Pro 5975WX PBO+200 | Asrock WRX80 Creator | NVIDIA GeForce RTX 4090 FE | 64GB DDR4-3600 Octo-Channel | Windows 11 22H2
MacBook Pro 14in | M1 Max (32 GPU Cores) | 64GB LPDDR5 6400 | macOS 12
Find
Reply
02-25-2015, 04:22 PM (This post was last modified: 02-25-2015, 04:26 PM by degasus.)
#3
degasus Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 1,827
Threads: 10
Joined: May 2012
@MaJoR: No, I think he means on the last screen blit. This option is just for ingame texture usage.

iirc default should be linear filtering, but I'll look at it.

Edit: At least we try to do so.
Find
Reply
02-25-2015, 07:13 PM
#4
KrossX Offline
クロスエクス
**
Posts: 20
Threads: 2
Joined: Aug 2009
Yah, I checked that and makes me think it might be a driver bug. Since my build setup just fails, I went the easy way with the shader. =P
[Image: EvQ2eUi.png]
Find
Reply
02-26-2015, 09:43 AM
#5
Darkness Knight Offline
Member
***
Posts: 219
Threads: 8
Joined: Feb 2010
Hi KrossX =)

Salu2 - Darkness Knight.
CPU: Core i7 4770k @ 3.9GHz
GPU: Geforce GTX1070 @ v511.79
SPU: X-Fi Titanium Fatal1ty Pro @ XP 2.17.0001.8
O.S: Win10 21H2 x64

RetroPCEmuGaming Youtube Channel
Website Find
Reply
02-26-2015, 11:38 AM
#6
KrossX Offline
クロスエクス
**
Posts: 20
Threads: 2
Joined: Aug 2009
It's DK! Hello~ =D

PS: Sorry for the offtopicness.
[Image: EvQ2eUi.png]
Find
Reply
03-02-2015, 07:14 PM
#7
KrossX Offline
クロスエクス
**
Posts: 20
Threads: 2
Joined: Aug 2009
(02-25-2015, 04:22 PM)degasus Wrote: @MaJoR: No, I think he means on the last screen blit. This option is just for ingame texture usage.

iirc default should be linear filtering, but I'll look at it.

Edit: At least we try to do so.

Interestingly, forcing filtering does affect the last blit (and everything else). This lack of filtering doesn't happen with every title, but I've been messing around a bit (yay! it compiles) and adding glBindSampler(0, 0); after line 155 seems to do the trick. I suppose there's an active sampler overriding the texture params.
[Image: EvQ2eUi.png]
Find
Reply
03-02-2015, 07:17 PM (This post was last modified: 03-02-2015, 07:18 PM by degasus.)
#8
degasus Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 1,827
Threads: 10
Joined: May 2012
Woo, that sounds really bad. We should use the unit 9 ...
Find
Reply
03-03-2015, 03:00 AM
#9
KrossX Offline
クロスエクス
**
Posts: 20
Threads: 2
Joined: Aug 2009
Opened issue 8298. I should've started with testing previous versions... T_T
[Image: EvQ2eUi.png]
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode