rdg Posted April 25, 2008 Share Posted April 25, 2008 What I still cannot explain: Why do I get dirty tiling seams as soon as I repeat my texture coordinates in VOP/VEX? ss = (s * freq) % 1 produces instant dirt Is raising the shading rate for the object to insane values really the only way to get rid of those artefacts? dirtyTilings.hip Any comment is appreciated. Georg Quote Link to comment Share on other sites More sharing options...
rjpieke Posted April 25, 2008 Share Posted April 25, 2008 You can get rid of the "dirt" by just ditching the modulo operator. The texture node has its "wrap" parameter set to "repeat", so modulo is unnecessary. When you're using the operator, you have one edge where s=1 at the end of one texture and, right beside it, s=0 at the beginning of the next. So the arguably valid assumption is that you're sandwiching the whole image backward along that thin sliver of an area and, since you have a non-zero filter width in the texture node, you end up with the "dirt". You could reduce your filter-width to zero, but that'll quickly give you problems elsewhere Hope this helps! What I still cannot explain:Why do I get dirty tiling seams as soon as I repeat my texture coordinates in VOP/VEX? ss = (s * freq) % 1 produces instant dirt Is raising the shading rate for the object to insane values really the only way to get rid of those artefacts? dirtyTilings.hip Any comment is appreciated. Georg Quote Link to comment Share on other sites More sharing options...
rdg Posted April 25, 2008 Author Share Posted April 25, 2008 yes, it helped. I remember the "backward sandwich" from extreme closeups when I last time tried to solve this. I got more question about this but I first need to solve my daily shader before I can prepare the test cases. Thanks you! You can get rid of the "dirt" by just ditching the modulo operator. The texture node has its "wrap" parameter set to "repeat", so modulo is unnecessary. When you're using the operator, you have one edge where s=1 at the end of one texture and, right beside it, s=0 at the beginning of the next. So the arguably valid assumption is that you're sandwiching the whole image backward along that thin sliver of an area and, since you have a non-zero filter width in the texture node, you end up with the "dirt". You could reduce your filter-width to zero, but that'll quickly give you problems elsewhere Hope this helps! Quote Link to comment Share on other sites More sharing options...
rdg Posted April 28, 2008 Author Share Posted April 28, 2008 here is another "dirty tiling" issue: The problem is: I divide the UV space into n cells. I want to map a random part of my texture map to each cell. If I skip the random part and just map a fraction of the texture to the cells no dirt is visible I can even add an offset to each cell and everything is fine. Example: If my texture is 5 tilings wide one tile is in uv 0 to 0.2 wide. I want to add floor(rand(cell) * 5) * 1/5 to this uvs. In my dreams this would cause random tilings. As soon as I add an random offset to the cell uvs the dirt occurs. The dirt again is the complete texture backwards. 20080428_lettermatrix.hip letters.rat.tar.gz Quote Link to comment Share on other sites More sharing options...
rdg Posted April 28, 2008 Author Share Posted April 28, 2008 As the vopnetwork is rather uninformative here is a vex code that produces the same issue: surface dirty( string map = "$HIP/../tex/letters.rat"; // Name of the map string wrap = "clamp"; vector uv=0; // Texture coordinates vector Cd=1; float ntiles = 5; // tiles in the texture float cells = 3; // number cols or rows ) { float ss, tt, ssa, tta, ssb, ttb, me; vector dclr; // some color dclr = 1; if (map != "") { // uv or st if (isbound("uv")) { ss = uv.x; tt = uv.y; } else { ss = s; tt = t; } // repeat over ss and tt ssa = (ss * cells) % 1; tta = (tt * cells) % 1; // number each cell ssb = floor(ss * cells); ttb = floor(tt * cells); me = ssb * ttb + ssb; dclr = texture(map, ssa / ntiles + (1/ntiles) * floor(ntiles * random(me * 10.01)), tta, "wrap", wrap); } Cf = dclr; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.