3D Models?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
guru
Posts: 75
Joined: Sun Aug 01, 2004 2:15 pm

Post by guru »

I think you are a bit hard on timmie there, graf. zdoomgl is still very much in the making. I'm sure timmie will be open to all suggestions made in that direction, just drop him a line with some information on the basic editing tricks you would like to see supported, help him a bit with implementing them or at least explain the nature of the origial doom renderer's behaviour and we should soon see a very nice zdoomgl renderer. I do agree with the other stuff you said.
User avatar
Chilvence
Posts: 1647
Joined: Mon Aug 11, 2003 6:36 pm
Contact:

Post by Chilvence »

guru wrote: or at least explain the nature of the origial doom renderer's .
Heh. I think he can manage that much himself...

Anyway, even if wads like Eternal Doom could be accounted for easily, in light of what I can understand (or at least assume) about polymost, it still seems a bit roundabout. Perhaps even the line_horizon special would be a trivial thing to support with it.

Lexus: new 3d models today, wheee
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

guru wrote:I think you are a bit hard on timmie there, graf. zdoomgl is still very much in the making. I'm sure timmie will be open to all suggestions made in that direction, just drop him a line with some information on the basic editing tricks you would like to see supported, help him a bit with implementing them or at least explain the nature of the origial doom renderer's behaviour and we should soon see a very nice zdoomgl renderer. I do agree with the other stuff you said.
I wasn't hard on Timmie. I was hard on the current state of ZDoomGL. I know it's not finished but one can't deny that the priorities are a bit odd. For example, the renderer has massive problems (hence a complete rewrite) but dynamic lighting has to come first (to attract the geeks who can't accept Doom as it is.)

Normally I'd try to make it robust first and add the 'cool' stuff afterward.

About rendering hacks:

For self referencing sectors the best fix is to have 2 sectors assigned to each subsector: one for gameplay and one for rendering. The gameplay sector should be the same as it is now but for rendering any linedef which has the same sector at both sides should be considered inconclusive for sector assignment and all the neighboring subsectors checked whether they contain any conclusive sector reference. If done correctly such an approach will find all self referencing objects in the map and assign a meaningful render sector to them - biggest problem solved!

And this is my solution as C++ code:

Code: Select all

	fixed_t bbox[4];
	register line_t	*li;
	register sector_t *sector;
	int i,j, total = numlines;
	TArray<subsector_t *> undetermined;
	subsector_t * ss;
	bool found;


	for (i=0 ; i<numsubsectors ; i++)
	{
		ss=&subsectors[i];
		seg_t *seg = &segs[ss->firstline];
		ss->sector = NULL;
		ss->render_sector = NULL;
		M_ClearBox(ss->bbox);

		for(j=0; j<ss->numlines; j++)
		{
			seg->subsector=ss;
			M_AddToBox(ss->bbox,seg->v1->x, seg->v1->y);
			seg++;
		}

		// For gameplay just pick the sector from the first seg
		seg = &segs[ss->firstline];
		for(j=0; j<ss->numlines; j++)
		{
			if(seg->sidedef)
			{
				ss->sector = seg->sidedef->sector;
				break;
			}
			seg++;
		}

		seg = &segs[ss->firstline];
		for(j=0; j<ss->numlines; j++)
		{
			if(seg->sidedef && (!seg->PartnerSeg || seg->sidedef->sector!=seg->PartnerSeg->sidedef->sector))
			{
				ss->render_sector = seg->sidedef->sector;
				break;
			}
			seg++;
		}
		if(ss->render_sector == NULL) 
		{
			undetermined.Push(ss);
		}

		if(ss->sector == NULL)
		{
			Printf("P_GroupLines: Subsector %d a part of no sector!\n",i);
			continue;
		}
	}

	while (undetermined.Size())
	{
		bool deleted=false;
		for(i=undetermined.Size()-1;i>=0;i--)
		{
			subsector_t * ss=undetermined[i];
			seg_t * seg = &segs[ss->firstline];
			found=false;
			for(j=0; j<ss->numlines; j++)
			{
				if (seg->PartnerSeg && seg->PartnerSeg->subsector)
				{
					if (seg->PartnerSeg->subsector->render_sector)
					{
						ss->render_sector=seg->PartnerSeg->subsector->render_sector;
						undetermined.Delete(i);
						deleted=1;
						break;
					}
				}
				seg++;
			}
		}
		if (!deleted && undetermined.Size()) 
		{
			// This only happens when a subsector is off the map.
			// Don't bother and just assign the real sector for rendering
			for(i=undetermined.Size()-1;i>=0;i--)
			{
				subsector_t * ss=undetermined[i];

				ss->render_sector=ss->sector;
			}
			break;
		}
	}
Locked

Return to “Editing (Archive)”