Entity Texture

Blitz3D Forums/Blitz3D Programming/Entity Texture

For some reason, when I apply this texture, it darkens the mesh but you can't notice the texture details.
;;Create Ground
Function CreateGround()
	
	thelevel\ground = CreateMesh()
	
	thelevel\mesh = CreateSurface(thelevel\ground)
	AddVertex(thelevel\mesh,-1,0,1)
	AddVertex(thelevel\mesh,1,0,1)
	AddVertex(thelevel\mesh,-1,0,-1)
	AddVertex(thelevel\mesh,1,0,-1)
	AddTriangle(thelevel\mesh,0,1,2)
	AddTriangle(thelevel\mesh,2,1,3)
	
	thelevel\texture = LoadTexture("images/groundtexture1.png")
	EntityTexture thelevel\ground,thelevel\texture
	ScaleEntity thelevel\ground,10,10,10

End Function 


It's likely due to the texture coordinates being too scaled.


It's likely due to the texture coordinates being too scaled.



No. It's because you have all the texturecoords set to 0,0 by default. I'm guessing the texel at this position is black. You need to set the texture uv's with the last couple of param of addvertex.

Stevie

Perfect, it was the uv's, thanks a lot!

What's a texel?

A texel is a pixel on a texture. For instance, if your texture is 64x64, then one of those units, is a texel.