[SOLVED] shader - offsetmapping - Printable Version +- Xonotic Forums (https://forums.xonotic.org) +-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3) +--- Forum: Xonotic - Help & Troubleshooting (https://forums.xonotic.org/forumdisplay.php?fid=4) +--- Thread: [SOLVED] shader - offsetmapping (/showthread.php?tid=3377) |
shader - offsetmapping - hutty - 08-10-2012 dpoffsetmapping - 2 match8 148 does anyone know what these three numbers mean ... I cant find it in the q3map2 manual .. or the dp wiki ... ..im having issues with a shader where the sunken in areas are in too far ... and not getting enough light RE: shader - offsetmapping - Maddin - 08-10-2012 I wondered about this parameter too... yeah what the hell does that mean? RE: shader - offsetmapping - hutty - 08-12-2012 meh ... anyone? ... RE: shader - offsetmapping - hutty - 08-13-2012 nobody? (sorry if im being bumpy ... but its kinda important) RE: shader - offsetmapping - hutty - 08-15-2012 still noone?!? ... :: hutty puppyeyes one of the devs :: RE: shader - offsetmapping - PinkRobot - 08-16-2012 Well, I am not a dev (orly?) but seeing as nobody else has even tried so far, allow me to have a stab at it. (The lack of reaction so far takes away anyone's right to sneer at my ideas below, just to make that clear :p) This is what I found buried deep in the comments of a code commit: Code: dpoffsetmapping - SCALE match8 8BIT_PIXEL_VALUE_THAT_IS_BASE_LEVEL - I have no idea what SCALE does. Here's theory though: I am tempted to say it does something to scale the bumpmap. In your example, might the bumpmap image be half the width/height of the regular texture? - match8 seems to be a keyword, it's not a number. It has a relation to what you can use as the final value (8BIT_PIXEL_VALUE_THAT_IS_BASE_LEVEL) it seems. So Match8 means 8-bit in this case, I guess. - Which means for the final value you can pick a number between 0 and 255. Are bump maps 8-bit (do they have 256 shades of grey?) Then I guess the final value could define which of those 256 shades is to be used as the base level of the bumpmap? The palette's index number in that case, probably :p That brings up the question of what the heck the base level is. Is it the point where the bump map touches the normal surface/texture? That would make sense :p Then you could use this last value (148 in your case) to raise or lower the bumpmap I suppose. Most of what I wrote was inspired by what I found online: Code: change to offsetmapping syntax: And this, which is more about the parameter bias: Code: Offsetmapping: new "Bias" parameter that sets a custom "null point" instead of always having fixed one (at white), set as 0-255 byte additional "dpoffsetmapping" parm (dpoffsetmapping ) a value of 128 makes offsetmapping centered at gray (no effect at gray, black is positive offset, white is negative). Additinally "dpoffsetmapping disabled" now parsed correctly. To see difference of offsetmapping bias see this shot (animated): http://omnicide.legacy-of-kain.ru/work/omnicide000137.gif Now I am tempted to close this thread, mark as [SOLVED] and sticky it :p |