Tweaking fx files

i have to admit, i don’t know shit about shaders. rendermonkey seems to have a nice standard collection of shaders and i tried to use them within v4. obviously the stuff doesn’t work without adjusting the code structure to v4. i’m working on the brushed metal fx which takes 2 textures.

question 1. why does v4 not understand the command ‘bool’, there have been bool commands in the original code like ’ bool UIVisible = " false"; ’ ( has this something to do with the rendermonkey interface e.g. turn something on/off ? )

question 2. the code refers to external texture files but still provides pins for feeding something from within v4… is this a problem?

and yes…i ordered HLSL books to read, understand and learn ;) (but bloody amazon seems to be very slow these days)

BrushedMetal.fx (7.6 kB)

…that’s me up there…

sory for the delay on this one.

not sure what the effect is supposed to look like. but you should at least see something with the attached patch. needs a pixelshader2 card though.

q1: v4 does understand bool. but it does not understand most of the annotations (the things in brackets). annotations are just hints for the host application. would be nice to support more of them…one day. UIVisible just hints the application to show/or not this parameter in the user interface. since v4 ignores it you’ll see a pin appear for every paramter.

q2: no problem. texture files are only suggestions. again provided as annotations.

the other important things when working with effects are semantics. v4 understands many of them. but not all (press F1 on an open effect-editor to see a list). i made some changes to the .fx file so that it uses the COLOR semantic for a color parameter which lets vvvv display it as a color pin instead of just a 4 sliced value spread.

i marked the world-matrix as WORLD and the texture matrix as TEXTUREMATRIX (still texture transformation does not seem to work as expceted here. didn’t find why)

most important thing i changed though was the order of multiplication with the VIEWPROJECTION matrix in the vertexshader.

instead of:
mul(matrix, point)
in v4 you have to call:
mul(point, matrix)

can any gregor comment on this?

hope that helps for now.

brushedmetal.zip (3.4 kB)

cheers joreg,

gonna have a look at the fx file now and btw. the hlsl book finally arrived. i’m really interested in the shader universe and wonder if u guys give workshops on this matter…i find the textural programming quite hard to grasp.

chris

we do give workshops. though we don’t organize them. if you find some fellows in your area and find a space we could talk about a date. where are u situated?

i’m based in kiel, muthesius kunsthochschule…mr.oschatz been here already (in july) chatting about meso and my ventuz connection… unfortunately i’m more or less the only one who’s interested in shader stuff so i probably need to watch this site in case u do a shader workshop somewhere else.

kiel and schwabisch gmund is that far apart?

well…not that far…just 751.82 km ;)