| Author | Topics » Book an abo for this thread |  |
Z Strong supporter
 

Status:Offline Date registered: 03.08.2005 Post:72 Send Message | Created on 13.06.2006 - 00:32 |  |
Hm, I wonder if the process of shader development and testing could be somewhat simplified.
I never wrote a shader myself, but I know from my own programming experience that it's a lot about experimenting. On so many occasions you just have to see the results of your work in practice, you have to try it out, you have to test it.
Thats what I did with nearly all the shaders on this board. That includes getting it to run (copy shader files and/or change shader path in Pete's plugin, choose the right settings, ...), starting, changing some values in the shader files, restarting, repeat, comparing to other settings and other shaders, repeat, taking screenshots, ...
The way it is now, this is a very complicated and time consuming process.
So, in my opinion, anthing that makes things easier for you Shader programmer people would be a huge step forward in development of Pete's plugin. Maybe as important as improving the plugin itself. I'd love to see that.
Regards,
Z
|
|
|
ShadX  Real addict
  

Status:Offline Date registered: 20.01.2005 Post:267 Send Message | Created on 13.06.2006 - 12:25 |  |
you have many possibilities (Rendermonkey, CG toolkit, etc.) , but my preferred is Shadeview.
http://www.shadeview.net/
Small (5.6MB) and very fast. It support GLSL, ARB asm and NV asm.
Try it.
Bye
P.S.: you can use it only with screenshots or videos, but I think isn't a big problem for you...
|
Z Strong supporter
 

Status:Offline Date registered: 03.08.2005 Post:72 Send Message | Created on 13.06.2006 - 14:31 |  |
Great!
That's exactly what I wanted to see.
Many thanks.
|
guest  Real addict
  

Status:Offline Date registered: 30.07.2004 Post:856 Send Message | Created on 26.06.2006 - 14:10 |  |
Developing shaders with Pete's OGL2 plugin was quite fun acctualy.
You can change/test shader files without exiting the emulator. Then most gfx. plugin setting can be altered ingame.
The best thing that could happen would be a 3 pass capable plugin. Sometimes 2 passes aren't enough.
Example: 2xscaler, 2xscaler, effect shader.
Joining an effect shader with a scaler brings too much guesswork. Effect can be color effect, edge based effect, sharpening, smoothing, emboss...
|
Z Strong supporter
 

Status:Offline Date registered: 03.08.2005 Post:72 Send Message | Created on 05.07.2006 - 01:14 |  |
So what do I have to do to make the shader files posted on this board work with shadeview?
|
guest  Real addict
  

Status:Offline Date registered: 30.07.2004 Post:856 Send Message | Created on 05.07.2006 - 12:02 |  |
It's not very hard.
The easiest way is to take an existing (shadeview shader), study how the texels are mapped and rename the texel lookup variables so they match the texels and coordinates used in "our" shaders.
Then copy the rest of the code over the Shadeview shader code and it should work. 
|
Z Strong supporter
 

Status:Offline Date registered: 03.08.2005 Post:72 Send Message | Created on 06.07.2006 - 23:04 |  |
Yep, that's what I tried at first.
Unfortunately, there seem to be many identifiers which could be used (see shader_interface.txt in shadeview\docs directory).
I don't know how to program a shader, so any help would be appreciated. ; D
|
Z Strong supporter
 

Status:Offline Date registered: 03.08.2005 Post:72 Send Message | Created on 06.07.2006 - 23:14 |  |
Oh, and how are the *.slf and *.slv-Files connected with each other? I can only select one of them, but don't you need both to run the shader correctly?
|
guest  Real addict
  

Status:Offline Date registered: 30.07.2004 Post:856 Send Message | Created on 07.07.2006 - 04:28 |  |
The shader "files code" can be hidden in the main executable or dll file like in the OGL2 plugin (internal shaders).
You can write your own vertex file using the documented uniforms.
Most shaders can be ported in a simple way with texels maped in the Outlining.frag file (for example).
Texel map:
Texture coordinates-offset settings:
------------------------------------
fragment.texcoord[0]: (0, 0)
fragment.texcoord[1]: (0, +1)
fragment.texcoord[2]: (-1 texel, +1 texel)
fragment.texcoord[3]: (-1 texel, 0)
fragment.texcoord[4]: (-1, -1 texel)
fragment.texcoord[5]: (0, -1 texel)
fragment.texcoord[6]: (+1 texel, -1 texel)
fragment.texcoord[7]: (+1 texel, 0)
[Dieser Beitrag wurde am 07.07.2006 - 09:51 von guest aktualisiert]
|
Z Strong supporter
 

Status:Offline Date registered: 03.08.2005 Post:72 Send Message | Created on 12.07.2006 - 23:44 |  |
Thx. I think I'm beginning to understand.
Could you give one example and rewrite the following shader (it's one of your cartoon shaders) for shadeview?
uniform sampler2D OGL2Texture;
const float threshold = 0.20; // effects dark lines
void main()
{
vec3 c00 = texture2D(OGL2Texture, gl_TexCoord[5].xy).xyz;
vec3 c10 = texture2D(OGL2Texture, gl_TexCoord[1].xy).xyz;
vec3 c20 = texture2D(OGL2Texture, gl_TexCoord[2].zw).xyz;
vec3 c01 = texture2D(OGL2Texture, gl_TexCoord[3].xy).xyz;
vec3 c11 = texture2D(OGL2Texture, gl_TexCoord[0].xy).xyz;
vec3 c21 = texture2D(OGL2Texture, gl_TexCoord[4].xy).xyz;
vec3 c02 = texture2D(OGL2Texture, gl_TexCoord[1].zw).xyz;
vec3 c12 = texture2D(OGL2Texture, gl_TexCoord[2].xy).xyz;
vec3 c22 = texture2D(OGL2Texture, gl_TexCoord[6].xy).xyz;
vec3 dt = vec3(1.0,1.0,1.0);
float d1=dot(abs(c00-c22),dt);
float d2=dot(abs(c20-c02),dt);
float hl=dot(abs(c01-c21),dt);
float vl=dot(abs(c10-c12),dt);
float d = 0.5*(d1+d2+hl+vl)/(dot(c11,dt)+0.15);
gl_FragColor.xyz = (1.0+threshold-d)*c11;
}
What happens to the slv-file anyway?
|