home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Help with shaders!

by dp777 on 11/09/2007 06:51, 12 messages, last message: 11/10/2007 01:16, 3777 views, last view: 04/29/2024 21:29

Help! I tried to get new fullscreen shaders working, but I cant. I add them into "stdshader.cfg" in the data folder, but when I try to start them, it tells me it can't find them. PLEASE tell me where to put shaders! I tried putting them into a map.cfg file, but then it would only be for that one map and even then it doesnt work! HELP!

   Board Index   

#1: wrong way for getting help

by MeatROme on 11/09/2007 11:13

did you compare your attempt to
http://www.quadropolis.us/node/717

You can place your own shaders into autoexec.cfg (prolly best via a line "exec myshaders.cfg" and the shader tucked away in that file).
When distributing your map, you'd have to include this non-standard shader in it's cfg though ... of course.

If you really want some helpful help then you'd best tell us what you're trying to do and give us your preliminary shader-code to comment on.

There's a real shortage of shader code gurus (or even acolytes) ... so you should give as much info as possible!

reply to this message

#2: ..

by Julius on 11/09/2007 11:34

Please post your shader code :)


Anyways, since this is a nice place to start a general shader topic, here is a question that really confuses me:

In the description of the spring edition it said GLSL (the high level OpenGL2.0 shader language) is supported by Sauerbraten, yet all examples I have seen in the data/stdshader.cfg and elsewhere are written in the ARB assembly language ( http://en.wikipedia.org/wiki/ARB_(GPU_assembly_language) ).

More to come ;)

reply to this message

#3: ..

by Julius on 11/09/2007 11:41

This seems to be a good program to design ARB shaders (not tested by me yet, linux only it seems):
http://code.google.com/p/qshaderedit/

Originally I also thought this programm could be used, but it seems to be limited to GLSL:
http://lumina.sourceforge.net/?id=1
(again, not really tested yet)

Just trying to keep you updated while I learn and experiement so that everyone can benefit.

reply to this message

#4: Re: ..

by JadeMatrix on 11/09/2007 13:36, refers to #2

It's my impression that when things become supported in Sauerbraten, people don't take advantage of the features for a while. ;)

reply to this message

#5: ..

by Julius on 11/09/2007 14:18

Yeah but an example on how to use GLSL would be great, even though it seems like you can easily convert GLSL to ARB (GLSL gets compiled to ARB anyways before running it).

Its just that GLSL seems to be easier to get good tutorials for.

reply to this message

#6: Re: ..

by A-Baby_Rabbit on 11/09/2007 14:48, refers to #5

There is/was an example of GLSL at the very end of stdshader.cfg.

Meanwhile be aware that shader code is generated by saue script, and that you need to determine how the shader environment (uniforms, attributes, texture) are passed from C-land. So it's a little bit more work than just 'plugging-in' shader code found elsewhere on the web... But hey, opensource, blah - experiment and have fun ;-)

reply to this message

#7: ..

by Julius on 11/09/2007 15:35

Ahh must have missed that, thanks!
(although the stdshader.cfg really lacks comments on some parts :( )

About the sauerscript comment: Could you elaborate that further? Maybe with an example?

reply to this message

#8: Re: ..

by A-Baby_Rabbit on 11/09/2007 16:16, refers to #7

http://sauerbraten.org/docs/config.html#cubescript

reply to this message

#9: ..

by Julius on 11/09/2007 16:59

Ehh, thanks I guess :)

Back to figuring it out myself...

reply to this message

#10: Message censored by administrator

by dp123 on 11/09/2007 22:56

#11: AHG it keeps losing my account! GRRR!

by dp123 on 11/09/2007 22:57

the shader I\'m trying to get to work is...

shader 0 \"test\" [ @fsvs @setup4corners END ] [
@fsps
@sample4corners

TEMP t, u;

SUB t, s00, s20;
ADD t, t, s20;
SUB t, t, s22;
ADD t, t, t;

ADD u, s00, s02;
SUB u, u, s20;
SUB u, u, s22;
MUL u, u, u;

ADD t, t, u;

ADD result.color, sample, t;
MUL result.color, t, 1.2;

END
]

I found it in a old thread somewhere.
I dont know much about Sauer-modding, but I figures what MeatRome was trying to tell me to do was make a \"autoexec.cfg\" in the Sauer folder and then put \"setshader test\" in the map file, so I did that but nothing. I tried both setfullscreenshader and setshader commands. The setshader command didnt bring up the \"cant find shader\" thing, but nothing changed. At all. Uh, a \"step-by-step\" tutorial request wouldn\'t be out of line, would it...?

reply to this message

#12: Re: AHG it keeps losing my account! GRRR!

by MeatROme on 11/10/2007 01:16, refers to #11

how more explicit than
http://www.quadropolis.us/node/717
do you need it?
you've got your shader defined in autoexec.cfg - yes? - ok.
I /did/ suggest placing it in
my_freaky_shader.cfg
and running
exec my_freaky_shader.cfg
from either autoexec.cfg or possibly the map cfg - include my_freaky_shader.cfg when distributing.


then you've added some textures to your map cfg to use that shader - yes? - no?
ok:
e.g. your shader is called "test" then you
setshader test
texture 0 "path/to/file.ext"

load a texture to _use_ that shader
then
setshader stdworld
back to standard world shader (for aditional textures) ...

and in your map you then have to also use that texture - to be found at the end of your texture list.
try calling
/edittex 2000
repeatedly ;)

HTH

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53869155 visitors requested 71644349 pages
page created in 0.019 seconds using 10 queries
hosted by Boost Digital