Pete´s Messageboard... No ISO/BIOS requests!

Homepage Members Register Login Search Old board


Neuer Thread ...


AuthorTopics » Book an abo for this threadClose Thread Move Thread Fix the thread Print view Delete this thread

mongo51983 





Status:Offline
Date registered: 01.12.2004
Post:9
Send Message
...   Created on 18.04.2005 - 03:41Jump to top Quote this post Report this post Edit Delete


I'm looking for the formula to make a shader similar to HQ2X, 3X, or 4X.




mongo51983 





Status:Offline
Date registered: 01.12.2004
Post:9
Send Message
...   Created on 10.05.2005 - 22:03Jump to top Quote this post Report this post Edit Delete


Um....what do you mean by this. "Only for you.
(A first approximation of such shader)."




mongo51983 





Status:Offline
Date registered: 01.12.2004
Post:9
Send Message
...   Created on 13.05.2005 - 20:00Jump to top Quote this post Report this post Edit Delete


Oh ok thanks I would really like to see a HQxx shader or something like it and if you could make one that would be really great.




mongo51983 





Status:Offline
Date registered: 01.12.2004
Post:9
Send Message
...   Created on 11.06.2005 - 04:53Jump to top Quote this post Report this post Edit Delete


Did the shader get finished yet?




bkman 



...

Status:Offline
Date registered: 12.06.2005
Post:2
Send Message
...   Created on 12.06.2005 - 14:25Jump to top Quote this post Report this post Edit Delete


If you want something like HQ?X on the gpu, then you will want to have a look at this: http://vogons.zetafleet.com/viewtopic.php?t=8591

I have tried it with Dosbox and it works very well, so perhaps it would be possible to adapt Moe's algorithm to work with Pete's plugin.

Edit: Here is a comparison shot that I made:



The top picture is the openglhq @3X shader, and the bottom is HQ3X. Original @3X is here: http://img98.echo.cx/img98/8049/jazzorig8tt.png


[Dieser Beitrag wurde am 12.06.2005 - 19:14 von bkman aktualisiert]




mongo51983 





Status:Offline
Date registered: 01.12.2004
Post:9
Send Message
...   Created on 15.06.2005 - 01:07Jump to top Quote this post Report this post Edit Delete


That's pretty sweet.




ShadX ...
Real addict
.........



Status:Offline
Date registered: 20.01.2005
Post:266
Send Message
...   Created on 13.07.2005 - 12:07Jump to top Quote this post Report this post Edit Delete


For bkman,
"Moe's" OpenglHQ require tree passes, exactly:
SDL_openglhq_pass1.fp

!!ARBfp1.0

#
# Copyright (C) 2004 Jörg Walter <jwalt@garni.ch>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#

TEMP pixel0, pixel1, pixel2, pixel3;
ALIAS coord1 = pixel1;
ALIAS coord2 = pixel2;
ALIAS coord3 = pixel3;
ALIAS rmean = pixel3;
TEMP diff;

PARAM pixel_size = program.env[0];
ATTRIB coord0 = fragment.texcoord[0];
OUTPUT res = result.color;

PARAM coordmask = { 1, 0, 1, 0 };
PARAM weight = { 1.884313725490196078431372549, 3.768627450980392156862745098, 2.822790287990196078431372548, 0 };
PARAM mask = { 0.4710784313725490196078431372, 0, -0.4710784313725490196078431372, 0 };

MAD coord1.xy, pixel_size, coordmask, coord0;
MAD coord2.xy, pixel_size, coordmask.gbra, coord0;
ADD coord3.xy, pixel_size, coord0;

TEX pixel0.rgb, coord0, texture[0], 2D;
TEX pixel1.rgb, coord1, texture[0], 2D;
TEX pixel2.rgb, coord2, texture[0], 2D;
TEX pixel3.rgb, coord3, texture[0], 2D;

#
# Original formula, [0;255] per component, result range [0;764.83]:
# sqrt( (2+rmean/256)*r*r + 4*g*g + (2.99609375-rmean/256)*b*b )
# (see http://www.compuphase.com/cmetric.htm)
#
# Formula used in software hq2x scaler, range [0;31] per component, result range [0;2161.31] clamped to [0;255]:
# (0.5+(2*rmean/2048))*r*r + g*g + (0.7490234375-(2*rmean/2048))*b*b
#
# This code uses this formula, range [0;1] per component, result range [0;2161.31/255] clamped to [0;1]:
# (1.884313725490196078431372549+(2*rmean*0.4710784313725490196078431372))*r*r + 3.768627450980392156862745098*g*g + (2.822790287990196078431372548-(2*rmean*0.4710784313725490196078431372))*b*b
# (which means that the same trigger values can be used for both)
#

SUB diff.rgb, pixel0, pixel3;
ADD rmean.a, pixel0.r, pixel3.r;
MAD rmean.rgb, rmean.a, mask, weight;
MUL diff.rgb, diff, diff;
DP3_SAT res.b, rmean, diff;

SUB diff.rgb, pixel0, pixel1;
ADD rmean.a, pixel0.r, pixel1.r;
MAD rmean.rgb, rmean.a, mask, weight;
MUL diff.rgb, diff, diff;
DP3_SAT res.r, rmean, diff;

SUB diff.rgb, pixel0, pixel2;
ADD rmean.a, pixel0.r, pixel2.r;
MAD rmean.rgb, rmean.a, mask, weight;
MUL diff.rgb, diff, diff;
DP3_SAT res.g, rmean, diff;

SUB diff.rgb, pixel1, pixel2;
ADD rmean.a, pixel1.r, pixel2.r;
MAD rmean.rgb, rmean.a, mask, weight;
MUL diff.rgb, diff, diff;
DP3_SAT res.a, rmean, diff;

END

SDL_openglhq_pass2.fp

!!ARBfp1.0

#
# Copyright (C) 2004 Jörg Walter <jwalt@garni.ch>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#

TEMP pixel0, pixel1, pixel2, pixel3;
TEMP max;
ALIAS coord0 = pixel0;
ALIAS coord1 = pixel1;
ALIAS coord2 = pixel2;
TEMP min;
TEMP current_trigger;

PARAM pixel_size = program.env[0];
PARAM trigger = program.local[0];
ATTRIB coord3 = fragment.texcoord[0];

PARAM coordmask = { 0, -1, 0, .0625 };
PARAM factors = { 0.0627450980392157, 0.125490196078431, 0.250980392156863, 0.501960784313725 };
PARAM const = { 65536, 0.1666666666666666, 1, 0 };
ALIAS one_sixteenth = coordmask;

SUB coord0.xy, coord3, pixel_size;
MAD coord1.xy, pixel_size.x, coordmask, coord3;
MAD coord2.xy, pixel_size.x, coordmask.gbra, coord3;

TEX pixel0, coord0, texture[0], 2D;
TEX pixel1, coord1, texture[0], 2D;
TEX pixel2, coord2, texture[0], 2D;
TEX pixel3, coord3, texture[0], 2D;

MOV pixel1.r, pixel0.b;
MOV pixel2.g, pixel0.a;

ADD min, pixel1, pixel2;
ADD min, min, pixel3;
DP3 current_trigger.a, min, const.g;
MUL_SAT current_trigger.a, current_trigger.a, trigger.a;
MAX current_trigger.a, current_trigger.a, trigger.r;

MUL current_trigger.a, current_trigger.a, const.r;
MAD_SAT pixel1, pixel1, const.r, -current_trigger.a;
MAD_SAT pixel2, pixel2, const.r, -current_trigger.a;
MAD_SAT pixel3, pixel3, const.r, -current_trigger.a;

# on a Radeon 9500, these three expand to 6 native insns
#SLT pixel1, current_trigger.a, pixel1;
#SLT pixel2, current_trigger.a, pixel2;
#SLT pixel3, current_trigger.a, pixel3;

DP4 result.color.a, pixel3, factors;
MAD pixel2, pixel2, one_sixteenth.a, pixel1;
DP4 result.color.rgb, pixel2, factors;

END

SDL_openglhq_pass3.fp

!!ARBfp1.0

#
# Copyright (C) 2004 Jörg Walter <jwalt@garni.ch>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#

TEMP coord1, coord2, coord3, pixel0;
ALIAS pixel1 = coord1;
ALIAS pixel2 = coord2;
ALIAS pixel3 = coord3;
TEMP diff;
TEMP center_offset;
TEMP factors;

PARAM pixel_size = program.env[0];
PARAM const = { .0625, .5, .99609375, .001953125 };
ATTRIB coord0 = fragment.texcoord[0];
# r: 1/.875, b: .875 * .958 (from sdlopengl.cpp)
PARAM cap = { 1.142857142857142857127368540393064222371, -0.07142857142857143002735720305196309709572, .83825, .080875 };

TEX diff, coord0, texture[1], 2D;

MUL center_offset.xy, coord0, pixel_size.abgr;
FRC center_offset.xy, center_offset;

SUB coord3.xy, center_offset, const.g;
CMP coord3.xy, coord3, -pixel_size, pixel_size;
ADD coord3.xy, coord0, coord3;
MOV coord1.x, coord3;
MOV coord1.y, coord0;
MOV coord2.x, coord0;
MOV coord2.y, coord3;

MAD_SAT center_offset.xy, center_offset, cap.r, cap.g;
MAD center_offset.xy, center_offset, cap.b, cap.a;

MAD center_offset.x, center_offset, const, diff.a;
MAD center_offset.z, diff, const.b, const.a;

TEX pixel0, coord0, texture[0], 2D;
TEX pixel1, coord1, texture[0], 2D;
TEX pixel2, coord2, texture[0], 2D;
TEX pixel3, coord3, texture[0], 2D;
TEX factors, center_offset, texture[2], 3D;

MUL pixel0, pixel0, factors.r;
MAD pixel0, pixel1, factors.g, pixel0;
MAD pixel0, pixel2, factors.b, pixel0;
MAD result.color, pixel3, factors.a, pixel0;

#MOV result.color, pixel0;
#MOV result.color, diff;
#MOV result.color, factors;

END

I'm not able to merge thease fragment programs in one... and Pete's plugin support only one pass...
Bye




mongo51983 





Status:Offline
Date registered: 01.12.2004
Post:9
Send Message
...   Created on 16.07.2005 - 04:58Jump to top Quote this post Report this post Edit Delete


So am I able to use the formula you just posted for the filter? If so which one do I use, 1, 2, or 3?





Similarly threads:
Topics Created by Replies Boardname
C2D-HQ2x(1.11)__and__CComic(1.02)__(by Chris) maruke 6 pete_bernert
hq2x GLSL shader ShadX 1 pete_bernert
What's a Shader Near 1 pete_bernert
HQ2x / 4x / 5x Z 2 pete_bernert
Natural Vision Shader + AA Shader v2.o = Best Shader for 2d !! zaykho 10 pete_bernert
Neuer Thread ...





Masthead

This forum is a free service of razyboard.com powered by:
Geizkragen Price Comparison. Top product in the price comparison: Krups Nespresso Essenza (XN2001)
Do you want a free forum in less than two minutes? Then click here!



Verwandte Suchbegriffe:
hq2x shader | dosbox hq2x | dosbox scaler comparison | dosbox 4x scaler | dosbox scaler | hq2x | hq3x shader | dosbox scaler 4x
blank