Some questions

Blitz3D Forums/Blitz3D Beginners Area/Some questions

Sonic65(Posted 2008) [#1]
1. When I load and display my level mesh in B3D, there are visible 1-pixel seams between the "grass cliff" and "cliff" texture areas, which aren't in my model editor. I know this isn't a seam problem in the texture itself, because they fit together fine.

Pic of this, from a program that just displays the mesh on a gray background:




2. As you might be able to tell from the above screenshot, I'm using sswift's cel-shading outline routines from the code archives to outline the level mesh. However, this doesn't look very good IMO. Would it be possible to get the outline to look more like this, except thinner (warning: crappy 5-minute MSPaint drawings)?:



I've tried searching the forums to find the answers to these questions, but nothing helpful came up.


GfK(Posted 2008) [#2]
No idea on the first problem. Could try using the U/V clamp texture flags.

Problem 2 - duplicate the mesh, colour it solid black, scale it up a tiny bit, flip its normals, draw it before the actual level.

I think that'll give the effect you're after.


Gabriel(Posted 2008) [#3]
Make sure your textures are power of two in width and height. This is exactly the sort of effect I would expect to see if the texture was being resized internally because you were trying to use a texture of the incorrect dimensions.


Sonic65(Posted 2008) [#4]
Make sure your textures are power of two in width and height. This is exactly the sort of effect I would expect to see if the texture was being resized internally because you were trying to use a texture of the incorrect dimensions.


All textures in the model are either at 256x256 or 512x512. Here is a wireframe overlay of the model from B3D, if that helps:






GfK: I tried the solution you posted, but it didn't give me the exact effect I wanted. For example, when I render a cube with the outline function I made, it looks like this:



But I'm aiming for it to look like this:




In case I did something wrong, here's the code I wrote:

Function MeshOutline(parentMesh, Thickness#=1.05)


	OutlineMesh = CopyMesh(parentMesh) 	
							
	ScaleMesh OutlineMesh,Thickness,Thickness,Thickness
	UpdateNormals OutlineMesh 
	EntityFX OutlineMesh, 1
	
	
	SurfaceNum = CountSurfaces(OutlineMesh)
	
	For SurfaceCounter = 1 To SurfaceNum
	
		Surface = GetSurface(OutlineMesh, SurfaceCounter)
		VertNum = CountVertices(Surface) - 1
		
		For VertCounter = 0 To VertNum-1
		
			vNormX# = VertexNX#(Surface, VertNum)
			vNormY# = VertexNY#(Surface, VertNum)
			vNormZ# = VertexNZ#(Surface, VertNum)
										
			VertexNormal Surface, VertNum,-vNormX,-vNormY,-vNormZ

		Next

	Next


	EntityColor OutlineMesh, 0, 0, 0
	PositionEntity OutlineMesh, EntityX#(parentMesh), EntityY#(parentMesh), EntityZ#(parentMesh)
	EntityParent OutlineMesh, parentMesh
	
	Return OutlineMesh


End Function



GfK(Posted 2008) [#5]
In case I did something wrong, here's the code I wrote:
No, that's exactly the result I expected (and I thought you wanted).


Sonic65(Posted 2008) [#6]
No, that's exactly the result I expected (and I thought you wanted).


Oh, okay. Do you think there would be any way to get the result like in the picture I posted?


Also, if it helps diagnose the problem, Blitz3D also vertically flips the textures of my model when I load them, which means the actual texture files aren't as shown in the pic; they're flipped upside-down.