HardwareHeaven.com

HardwareHeaven.com

Looking for the skin chooser?
 
 
  • Home

  • Hardware reviews

  • Articles

  • News

  • Tools

  • Gaming at HardwareHeaven

  • Forums

 

Go Back   HardwareHeaven.com > Forums > News > Other Tech News


Other Tech News The latest community based technology news from across the globe. (If you aren't a community newsposter then use the "Submit News" section.)

Reply
 
Thread Tools
Old Feb 19, 2004, 07:53 AM   #91
DriverHeaven Newbie
 
Join Date: Oct 2003
Posts: 2
Rep Power: 0
Arrghman is on a distinguished road

Quote:
Originally posted by taurus1900
How do you use more than one user defined texture? Below is the code I'm trying.
In the line
TEX temp3, fragment.texcoord[0], texture[1],2D;
it always uses the last texture that was loaded so in this case it uses the "normalNoiseColor.raw" texture not "256x256.raw".

Can anybody give me an example of how to use multiple textures??
You have to define what texture[1] is before you call the function, by going texture[1].source = surfacename

So, if you wanted to use the "noarmalNoseColor.raw" texture, put the line texture[1].source = normalnoise above the call for apply dirtPixelShader. That should work, if I understand your problem correctly!


Now, a question of my own... is a list anywhere of the available instructions, what they do and the arguments they take? From Googling, I've found some lists, but some of the instructions I found arent recognized (I assume I managed to find instructions on a similar ISA or something) and some of them I just plain don't know what they do or they want more arguments then I think they should have. I've been lucky in a few cases (thank goodness SLT and SGE did what I expected them to ), but it'd be quite helpful to get a full list

Wish I had come to this board earlier, I was pulling my hair out trying to figure out why the alpha information I was modifying wasn't sticking, now I know!
Arrghman is offline   Reply With Quote


Old Feb 19, 2004, 03:56 PM   #92
DriverHeaven Newbie
 
Join Date: Feb 2004
Posts: 5
Rep Power: 0
tentacle is on a distinguished road

multiple textures

can someone please explain how to use more than one user defined texture ?
i tried something like this:

surface ascii = allocsurf(8*64, 10);
load_texture(1, 8*64, 10, 1, "ubyte", "ascii8x10.raw");

texture[0].source = backbuffer;
texture[1].source = ascii;
destination temp1;
apply blablaShader;

it didnt work

but when i left out the
texture[1].source = ascii;
line, it did work.
so whats the problem here?
i'd need something like this


surface temp1 = allocsurf(width, height);
surface temp2 = allocsurf(width, height);
surface temp3 = allocsurf(width, height);

texture[0].source = temp1;
texture[1].source = temp2;
destination temp3;
apply pShaderOne;

texture[0].source = temp3;
texture[1].source = (some texture loaded from a file) ;
destination backbuffer;
apply pShaderTwo;


how can i accomplish this ?
tentacle is offline   Reply With Quote
Old Feb 20, 2004, 01:49 AM   #93
ATI Guru
 
Maurice ATI's Avatar
 
Join Date: Feb 2004
Location: Marlboro, MA
Posts: 9
Rep Power: 0
Maurice ATI is on a distinguished road

I think the problem you people who are having trouble with multiple textures has already been addressed by Roger. There is a bug that prevents loading of a texture from happening until after the first shader is applied. You can work around this by creating a 1x1 surface and applying a dummy shader to it to force your textures to get loaded. You can see on the asccii shader we apply the downsample shader before we try to access the ascii texture and that is why we never noticed the bug. Roger has fixed this and it should work in a future driver, but for just work around it.


Arrghman, I'm not sure if you're talking about arb_fragement_program instructions or instructions handled in smartShader scripting language. If your talking about arb_fragment_program the spec lists them all and it can be found at: http://oss.sgi.com/projects/ogl-samp...nt_program.txt If you want to know about the scripting language look at http://www.hardwareheaven.com/smartshader/ http://www.hardwareheaven.com/rogerATI/ and the example programs.
Maurice ATI is offline   Reply With Quote
Old Feb 20, 2004, 01:53 AM   #94
DriverHeaven Newbie
 
Join Date: Oct 2003
Posts: 2
Rep Power: 0
Arrghman is on a distinguished road

The fragment_program.txt file has exactly what I was looking for, thanks very much!
Arrghman is offline   Reply With Quote
Old Feb 22, 2004, 12:38 AM   #95
DriverHeaven Newbie
 
Join Date: Feb 2004
Location: NSW, Australia
Posts: 4
Rep Power: 0
llewbob is on a distinguished road

posterize filter

i'm trying to write a posterizer filter but i don't seem to have a full grasp of how this works...

my idea is to multiply the channel values by a constant, chop off the fractional part, and then divide by the same constant as before, to leave the image with a much smaller number of discrete values.

val = {trunc(pixel.r*mult)/mult, trunc(pixel.g*mult)/mult, trunc(pixel.b*mult)/mult, 1};
MOV oColor, val;

unfortunately it doesn't work, and i get this:
line 17: invalid statement.

any ideas/help would be much appreciated
llewbob is offline   Reply With Quote
Old Feb 22, 2004, 04:51 AM   #96
ATI Guru
 
Maurice ATI's Avatar
 
Join Date: Feb 2004
Location: Marlboro, MA
Posts: 9
Rep Power: 0
Maurice ATI is on a distinguished road

You can't *, /, or use trunc() inside a fragment shader. You probably want to look at the Green Ascii.pss example since that does what you want to do. Pay special attention to the FRC comand in the fragment shader which gets the decimal portion of the floating point number. The interview with Roger and myelf here at DriverHevean goes into the details of how Green Ascii.pss works. If you'd rather work it out on your own that's great, just remember the that fragment programs are like assembly code and you can only do one thing per line.
Maurice ATI is offline   Reply With Quote
Old Feb 22, 2004, 06:41 AM   #97
DriverHeaven Newbie
 
Join Date: Feb 2004
Location: NSW, Australia
Posts: 4
Rep Power: 0
llewbob is on a distinguished road

thanks alot Maurice!
i had another go at making the posterizer using the information you gave me (but without looking at the ascii example), and now it works, and looks as good and as ugly as could be expected.
llewbob is offline   Reply With Quote
Old Feb 23, 2004, 06:09 AM   #98
DriverHeaven Newbie
 
Join Date: Feb 2004
Location: NSW, Australia
Posts: 4
Rep Power: 0
llewbob is on a distinguished road

i 'made' a classic style filter incorporating the sepia filter, the porthole filter (to create a more subtle vignette effect), the posterizer filter i made, and some flicker.
it looks fairly effective

what sort of effects are other people coming up with?
llewbob is offline   Reply With Quote
Old Feb 23, 2004, 02:58 PM   #99
DriverHeaven Newbie
 
Join Date: Feb 2004
Posts: 5
Rep Power: 0
tentacle is on a distinguished road

what effects ?

1) i wrote some program that has some ui where you can combine different effects and it generates a smartshader for it
2) question:
how can i load more than one user-defined texture and switch between them ?

like this:
texture[1].source=noiseTex;
apply addNoiseShader
texture[1].source=colorMap;
apply addColorMapping

where noiseTex & colorMap should be loaded from 2 external files
tentacle is offline   Reply With Quote
Old Feb 23, 2004, 11:04 PM   #100
ATI Guru
 
Maurice ATI's Avatar
 
Join Date: Feb 2004
Location: Marlboro, MA
Posts: 9
Rep Power: 0
Maurice ATI is on a distinguished road

tentacle - The only way to do that with the current implementation of smartShader is to put the color map in texture unit 2. This should be fine so long as your total texture usage doesn't exceed 8. If it does I commend you on one complex shader And then you could work around that by merging multiple textures into one unit and then modifying your texture coordinates to grab data from the proper part of the texture.
Maurice ATI is offline   Reply With Quote
Old Feb 29, 2004, 01:19 PM   #101
DriverHeaven Newbie
 
Join Date: Feb 2004
Posts: 5
Rep Power: 0
tentacle is on a distinguished road

load_texture(2, 8*64, 10, 1, "ubyte", "chars512x10.raw");

texture[0].source = dummy;
destination dummy;
apply copyPixelShader;

load_texture(3, 64, 64, 1, "ubyte", "noise64x64.raw");

texture[0].source = dummy;
destination dummy;
apply copyPixelShader;


it reads noise into tex slot 3 fine, but i get parts of noise tex + some random into tex slot 2

help pls ....
tentacle is offline   Reply With Quote
Old Jun 12, 2004, 12:20 PM   #102
DriverHeaven Newbie
 
Join Date: Jun 2004
Posts: 1
Rep Power: 0
ubot is on a distinguished road

Hi!
I would like to know if there is any template just for changing color saturation? Unfortunately I can't manage this smartshader stuff and I as a IL2FB player I think that deacreasing color saturation would improve alot game environment.
Thanks!
ubot is offline   Reply With Quote
Old Oct 23, 2004, 11:13 PM   #103
DriverHeaven Newbie
 
Join Date: Oct 2004
Posts: 1
Rep Power: 0
nephex is on a distinguished road

what happened to this competition?
is it still going on?'


edit: heh, nevermind
nephex is offline   Reply With Quote
Reply

Thread Tools