Jump to content


Photo

TDM Engine Development Page

idtech4 development engine

  • Please log in to reply
1054 replies to this topic

#801 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1032 posts

Posted 28 July 2018 - 01:44 AM

Oh forgot fixed warnings in libpng ldap ffmpeg and openal.

Fixing warning in third-party libraries is not a good idea, since you usually don't control them (and next library update will revert all your fixes).

Better reduce warnings level or use pragma warnings to remove them.

Starting from TDM 2.06, all third-party libraries are compiled as a part of ExtLibs, so we don't even suppress any third-party warnings now --- ExtLibs is almost never recompiled, so they don't bother anyone.

 

Yikes the msvc profiler for msvc 2013 and upto 2017 is broken on win 7 with the latest update and theres no plans on fixing it.

It will hard reset your pc if run and probably ruin the solution files as well, just a warning.

I hit this issue on my work machine.

The problem is caused by Spectre/Meltdown mitigations, which break profiler driver on Windows 7.

You can disable these mitigations (leaving your OS vulnerable to potential Spectre/Meltdown exploits) to make profiler work. More details here (or here).


  • Anderson likes this

#802 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 28 July 2018 - 05:29 AM

True, got a little carried away there :).

 

So the spectre/meltdown patches strike again...

had a number of those problems, luckily most where fixed in later updates to some programs i used but sheesh microsoft wont even fix the problem in there own software in an OS they still support (atleast untill im forced to use that abomination they made with Win10) sigh...


  • Anderson likes this

#803 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1635 posts

Posted 28 July 2018 - 11:05 AM

By all mean, please use any formatting style you want

But don't do formatting changes in bulk.


  • stgatilov likes this

#804 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 28 July 2018 - 11:24 AM

Sorry im afraid my astyle plugin was set to automatic :/ i have it turned off now, so if i want to format i will have to do it manually document by document.

 

Still need to setup a few things in my environment.



#805 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 28 July 2018 - 02:56 PM

Btw i made an experiment of moving the depthcopy code to FBO like this

void FB_CopyDepthBuffer() { // AA off: already have depth texture attached to FBO. AA on: need to blit from multisampled storage
	if ( primaryOn && r_multiSamples.GetInteger() > 1 ) {
		FB_ResolveMultisampling( GL_DEPTH_BUFFER_BIT );
	} else {
		globalImages->currentDepthImage->CopyDepthBuffer(
			backEnd.viewDef->viewport.x1,
			backEnd.viewDef->viewport.y1,
			backEnd.viewDef->viewport.x2 -
			backEnd.viewDef->viewport.x1 + 1,
			backEnd.viewDef->viewport.y2 -
			backEnd.viewDef->viewport.y1 + 1, true);
	}
}

so a bit like the colorbuffer code just above which also ment i could remove the r_useFBO cvar check and simplify the code a great deal.

It seems to work when i test it in game, but are there any specific test maps avaliable where i can check to make sure that it works for certain ?



#806 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1635 posts

Posted 28 July 2018 - 03:15 PM

Btw i made an experiment of moving the depthcopy code to FBO like this

void FB_CopyDepthBuffer() { // AA off: already have depth texture attached to FBO. AA on: need to blit from multisampled storage
	if ( primaryOn && r_multiSamples.GetInteger() > 1 ) {
		FB_ResolveMultisampling( GL_DEPTH_BUFFER_BIT );
	} else {
		globalImages->currentDepthImage->CopyDepthBuffer(
			backEnd.viewDef->viewport.x1,
			backEnd.viewDef->viewport.y1,
			backEnd.viewDef->viewport.x2 -
			backEnd.viewDef->viewport.x1 + 1,
			backEnd.viewDef->viewport.y2 -
			backEnd.viewDef->viewport.y1 + 1, true);
	}
}

so a bit like the colorbuffer code just above which also ment i could remove the r_useFBO cvar check and simplify the code a great deal.

It seems to work when i test it in game, but are there any specific test maps avaliable where i can check to make sure that it works for certain ?

That's an extra copy of depth buffer. It may not change anything visually but it will increase GPU load and potentially affect FPS when AA is off.



#807 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 06 August 2018 - 06:52 PM

Was afraid of that, would have been nice though.

Reverted though im looking into making it a bit less complicated.



#808 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 14 August 2018 - 06:10 AM

Ok upped my recent changes.

Fixed an attempt at minimizing scissoring in tr_render.cpp.

Non FBO DepthCopy and FrameCopy refined a bit.

Now using c++11 nullptr in places where NULL was used, In C++ NULL is not a pointer to 0 but an octal integer 0 in C NULL is a pointer to 0 but that does not apply to C++.

Fixed a function which was shadowed by another function of the same name.

Made some changes to make lightdepthbounds more uniform, cut down on having to use the same cvar all over to one.

Added lightdepthbounds to the GLSL renderers stencil shadow part also since it was missing there, was this intentional ?. (no adverse effects and i tested it extensively so id reckon no, but who knows).

Reordered a few ugly externs, i hope the readability is a bit better now :).


  • Anderson likes this

#809 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1635 posts

Posted 14 August 2018 - 01:14 PM

Ok upped my recent changes.

Fixed an attempt at minimizing scissoring in tr_render.cpp.

Non FBO DepthCopy and FrameCopy refined a bit.

Now using c++11 nullptr in places where NULL was used, In C++ NULL is not a pointer to 0 but an octal integer 0 in C NULL is a pointer to 0 but that does not apply to C++.

Fixed a function which was shadowed by another function of the same name.

Made some changes to make lightdepthbounds more uniform, cut down on having to use the same cvar all over to one.

Added lightdepthbounds to the GLSL renderers stencil shadow part also since it was missing there, was this intentional ?. (no adverse effects and i tested it extensively so id reckon no, but who knows).

Reordered a few ugly externs, i hope the readability is a bit better now :).

E.g. this part (image attached)

 

What was changed here and with what intent?

 

99% of that massive commit looks like re-formatting. It's impossible to understand what logic was actually changed.

Attached Files


  • stgatilov likes this

#810 Abusimplea

Abusimplea

    Member

  • Member
  • PipPip
  • 471 posts

Posted 14 August 2018 - 01:47 PM

E.g. this part (image attached)

What was changed here and with what intent?

The image contains no logic changes but improves the code readability by adding some curlies.



#811 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 14 August 2018 - 06:30 PM

Look for revelator in the comments, i commented the changes extensively.

Some formatting also took place to improve readability.

 

I will allways comment my changes in case formatting screws up where the real changes are.

 

lots more changes really but i left out the fixes for warnings in extlib since as we discussed they might change a lot with updates to curl jpeg png ldap etc,

so next time one of those libraries gets updated all those changes would have to be redone anyway.



#812 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9000 posts

Posted 14 August 2018 - 09:23 PM

Heh.

 

You fixed the underwater rendering issue in SVN so there's that.

 

:)

 

I'll keep testing. :)


  • Bikerdude, AluminumHaste and Anderson like this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#813 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1886 posts

Posted 15 August 2018 - 01:06 AM

Can you update the beta binaries nbohr?


Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.


#814 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 15 August 2018 - 03:27 AM

good :) so approved ?


  • nbohr1more likes this

#815 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 15 August 2018 - 04:34 AM

This might have been the culprit causing underwater to break ->

 

RB_DrawElementsWithCounters.

 

since this function was shadowed by a function of the same name but using 32 bit unsigned integers instead for the experimental multidraw function.

 

I renamed that one to RB_DrawElementsWithCountersBaseVertex.

 

It takes two arguments instead of one so it might have been ok to overload it but PVS studio bitched rather loudly about it so i went with the safer approach.

 

This was btw the only place it was used RB_FillDepthBuffer_Multi.


  • Bikerdude likes this

#816 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 15 August 2018 - 05:34 AM

Tried RB_FillDepthBuffer_Multi just for fun and it works sorta, it breaks skyportals so thats not so good but might be fixable.

 

Moving to batch rendering would be a nice goal though :)

 

I was also wondering if i should modify the whole shebang to use glew instead of the old way ?, it would not benefit us any performance wise but it would cut down on quite a lot of the clutter.

 

But it would also add to the complexity of the build scripts for linux since many distros use old versions of that library, so im a little conflicted.



#817 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 15 August 2018 - 10:16 AM

Replaced old TGA code with the more recent TGA2 code, benefit is that we no longer require the image flipping code hacks that has plaged TGA for years.

Also it supports way more formats ;) 8, 15 ,16 ,24, 32 bit with RLE or without.

 

Visually it's a bit crisper, but nothing fancy.


  • AluminumHaste, RPGista and Anderson like this

#818 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 15 August 2018 - 10:26 AM

Since the engine supports loading bitmaps, i do actually have code for loading those from compiled resources.

While not exactly nessesary, one could use it for loading static images such as the background of the loading screen from the game dll.

Or it could also be used for loading default particlefonts without the need for any externals,

unless the mapper actually wants to use a non default particlefont, in which case they can be overridden.

 

I would adwise against loading all textures this way though since the exe would take on dimensions that only a 64 bit OS would be able to handle (think 100's of mb's or even gb's).

It was originally used in a quake engine of mine for particles and effects such as underwater caustics.


  • AluminumHaste likes this

#819 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9000 posts

Posted 15 August 2018 - 10:46 AM

I didn't see any performance regressions in the little testing I did last night.

So far so good.

 

I was gonna check on the disposition of this tracker:

 

http://bugs.thedarkm...iew.php?id=4697

 

I fixed some of these myself, but my fixes are a little bit hacky.

 

If you wanna take a gander and improve things, that would be near the top of our remaining 2.07 priorities on the render side.

 

I'll post binaries to Moddb tonight.


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#820 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 15 August 2018 - 11:43 AM

Ok ill look into it :)



#821 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1635 posts

Posted 15 August 2018 - 11:55 AM

The image contains no logic changes but improves the code readability by adding some curlies.

You understand that it leads to numerous unnecessary merge conflicts in branches other than trunk?



#822 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1606 posts

Posted 15 August 2018 - 11:56 AM

Btw. speaking of other debug commands not working properly in 2.06, r_showTris 1-3 displays glitches and artifacts when looking through visportals. Weird thing is that this bug doesn't appear on screenshots.



#823 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 15 August 2018 - 01:53 PM

Yeah formatting can be dangerous, for one do not ever use it on inline assembler code or you will have a mess on hand the likes which you would probably not like to fix again.

Ill keep further changes unformatted.

 

r_showtris bugs out ?, does this happen with FBO on or off or both ?



#824 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1606 posts

Posted 15 August 2018 - 01:59 PM

This is with FBO on, I can't test it switched off as I have nvidia card where it's forced to be on.



#825 revelator

revelator

    Advanced Member

  • Development Role
  • PipPipPip
  • 560 posts

Posted 15 August 2018 - 02:16 PM

I see what you mean now, looks like theres a broken mirror smacked up on the viewport.

 

Looks like the debug tool code has not been converted to use vertex attributes yet, not sure if that would cause this kind of breakage but its worth looking into, especially since most of the renderer is now GLSL based.







Also tagged with one or more of these keywords: idtech4, development, engine

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users