Jump to content

dirty tilings


rdg

Recommended Posts

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

post-960-1209119666_thumb.jpg

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

Link to comment
Share on other sites

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

post-960-1209119666_thumb.jpg

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

here is another "dirty tiling" issue:

post-960-1209370786_thumb.jpg

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

Link to comment
Share on other sites

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;
}

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...