Jump to content

Texture bright dots on terrain


YouGroove
 Share

Recommended Posts

Okay, the problem was the auto-generated normal map that gets created if no normal texture is present was getting the last pixel skipped when setting the pixel data:

		//Create default normal
	texture_defaultnormal = Texture::Create(64,64,Texture::RGBA);//Texture::Load("Materials/Common/normal.tex");
	Bank* data = Bank::Create(64*64*4);
	for (int i = 0; i < data->GetSize()/4-1; ++i) // The -1 is the culprit!!!
	{
		data->PokeByte(i*4+0, 127);
		data->PokeByte(i*4+1, 127);
		data->PokeByte(i*4+2, 255);
		data->PokeByte(i*4+3, 255);
	}
	texture_defaultnormal->SetPixels(data->buf);
	data->Release();
	texture_defaultnormal->BuildMipmaps();

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...