shadow shader?
Hello, sorry everyone for asking so many questions lately, but Ive been working in jitter nonstop for a couple weeks on a few big installations for the MOCA out here in miami, and I have had to learn alot of stuff to implement all the things I want to with it. Its turning out great by the way.
Anyway, as the title says, does anyone have a shadow shader or something that can make shadows within geometry? I don't need like a cast shaddow from something onto the ground, but a complex piece of geometry with shadows from its various parts casting onto itself. Anyone have something like this? I have seen some great ambiant occlusion shaders elsewhere that did great soft shadows but the one that someone on the list had translated didn't do shadowing. Soft shadows preferred but any shadows would do.
Thank you!!!
would something like this work.. what needs to be modified?
[VERTEX SHADER]
varying vec4 shadowTexCoord;
void main (void)
{
// vertex calculation
gl_Position = ftransform();
// shadow texture coordinates generation
shadowTexCoord = gl_TextureMatrix[0] * gl_ModelViewMatrix * gl_Vertex;
}
[FRAGMENT SHADER]
uniform sampler2DShadow shadowMap;
varying vec4 shadowTexCoord;
void main(void)
{
gl_FragColor = shadow2DProj(shadowMap, shadowTexCoord).r * glColor;
}
still playing with converting it.. does this look anywhere in the ballpark?
would something like this work for a way to make jitter shaders?
your jxs code is trying to bind a param to a varying. you can only bind params to uniforms (and attribute), and you must bind all uniforms (yours does not).
you also have a varying declared only in the fragment shader. they must be declared and used in both fragment and vertex to be varying. you probably want the to be uniform.
jitter shaders are simply cg, glsl, or assembly shaders with some extra xml for parsing and binding uniforms. FXComposer creates cg shaders, so yes, the shader source can be ported to jxs.
however, you should really get the basics down first before you try this.
Ive been trying really.. I went through bensons tutorial the other day, and I have a history with qbasic/gwbasic and in highschool c++ and in college actionscript.. but Its been so long since I did any type coding that its taking a while for me to get back used to it. I know it will click soon, and its helping alot to make mistakes and have people show me what Im doing wrong.
hello
maybee its clumsy of me to mention the following. ive been working with vvvv the whole past six months and i checked this forum only occasionally, out of curiosity.
i've got a little into shader-programming, since vvvv has a pretty cool interface for that and seems to be a really progressive in that stuff. on their website is a great collection about lightning- and shading-shaders. its in hlsl though.. but still, in some (actually few) points i prefer jitter and i wonder how difficult it is to translate a hlsl shader into glsl..
maybee it helps. or some codes could inspire you
good luck
rhe
rhetoric wrote on Tue, 10 March 2009 08:44... i wonder how difficult it is to translate a hlsl shader into glsl..
not so hard as long as you know a little about both languages. what's even easier is to translate hlsl into cg. these two languages are quite similar, and of course jitter can handle cg shaders as well.
there are even converters that do this for you automagically, although i can't vouch for any of them.
-rob
where might I find these converters? do any of them work on mac?