Living Lands - Page 2

Living Lands

All map release threads should be posted here

Moderator: Moderators

User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Living Lands

Post by Anarchid »

Just make an 1px border?
aeonios
Posts: 202
Joined: 03 Feb 2015, 14:27

Re: Living Lands

Post by aeonios »

Anarchid wrote:Just make an 1px border?
"Just". SME won't do it that I can figure out, and I don't know how to do that without it being exceptionally tedious in any case. :|
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Living Lands

Post by qray »

SME: open map; export texture to bmp
Gimp: open; select all; selection: border, 1px; fill whole selection with color of choice; save
SME: import texture bmp; save map

Not sure if it will look good since 1px in diffuse can be quite large in final map; but since it's not much work it might be worth a try :-)
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Living Lands

Post by PicassoCT »

Code: Select all

void CSMFGroundDrawer::DrawBorder(const DrawPass::e drawPass)
{
	glEnable(GL_CULL_FACE);
	glCullFace(GL_BACK);

	SelectRenderState(false);
	// smfRenderState->Enable(this, drawPass);

	glColor4f(1.0f, 1.0f, 1.0f, 1.0f);

	glActiveTexture(GL_TEXTURE2);
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, smfMap->GetDetailTexture());

	//glMultiTexCoord4f(GL_TEXTURE2_ARB, 1.0f, 1.0f, 1.0f, 1.0f);
	//SetTexGen(1.0f / (mapDims.pwr2mapx * SQUARE_SIZE), 1.0f / (mapDims.pwr2mapy * SQUARE_SIZE), -0.5f / mapDims.pwr2mapx, -0.5f / mapDims.pwr2mapy);

	static const GLfloat planeX[] = {0.005f, 0.0f, 0.005f, 0.5f};
	static const GLfloat planeZ[] = {0.0f, 0.005f, 0.0f, 0.5f};

	glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
	glTexGenfv(GL_S, GL_EYE_PLANE, planeX);
	glEnable(GL_TEXTURE_GEN_S);

	glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
	glTexGenfv(GL_T, GL_EYE_PLANE, planeZ);
	glEnable(GL_TEXTURE_GEN_T);

	glActiveTexture(GL_TEXTURE3);
	glDisable(GL_TEXTURE_2D);
	glActiveTexture(GL_TEXTURE1);
	glDisable(GL_TEXTURE_2D);
	glActiveTexture(GL_TEXTURE0);
	glEnable(GL_TEXTURE_2D); // needed for the non-shader case

	glEnable(GL_BLEND);

		if (wireframe) {
			glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
		}
			/*if (mapInfo->map.voidWater && (drawPass != DrawPass::WaterReflection)) {
				glEnable(GL_ALPHA_TEST);
				glAlphaFunc(GL_GREATER, 0.9f);
			}*/

				meshDrawer->DrawBorderMesh(drawPass);

			/*if (mapInfo->map.voidWater && (drawPass != DrawPass::WaterReflection)) {
				glDisable(GL_ALPHA_TEST);
			}*/
		if (wireframe) {
			glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
		}

	glDisable(GL_BLEND);

	glActiveTexture(GL_TEXTURE2);
	glDisable(GL_TEXTURE_2D);
	glDisable(GL_TEXTURE_GEN_S);
	glDisable(GL_TEXTURE_GEN_T);

	glActiveTexture(GL_TEXTURE0);
	glDisable(GL_TEXTURE_2D);

	smfRenderState->Disable(this, drawPass);
	glDisable(GL_CULL_FACE);

	}
This is the herpetraitor.

Now a algo draft in pseudo code:

Code: Select all

DrawBorder()
{
//for x_axis
point tempPoint; //tempPoint
point p1;//startpoint
point Itterator;//itterator
float3 stripColour;
previousStrip=allNullTable();

	while (StripMax < Max(UpperCrustTable))
	{

	point p4

		while (NextPointIsWithinTreshold(p1,Itterator,treshold))
		{
		stripColour=  findDarkestColour(Terrain[tempPoint-Itterator]);
		tempPoint=Itterator;    
		Itterator=getNextPoint();
		}
	PointPair StripOne=new PointPair(p1,itterator);
	//we now have a set of points on the left side of a mountain - 
	//we needs the same thing on the opposite site
		p1=getStripSameHeightOnOtherSide(p1);
		
		Itterator=p1;
		while (NextPointIsWithinTreshold(p1,Itterator,treshold))
		{
		stripColour=  findDarkestColour(Terrain[tempPoint-Itterator]);
		tempPoint=Itterator;    
		Itterator=getNextPoint();
		}
	PointPair StripTwo=new PointPair(p1,itterator);
	
	Strip=	DrawStrip(StripOne,StripTwo, previousStrip);
	}
}
Post Reply

Return to “Map Releases”