It is currently Mon Jul 24, 2017 8:42 pm




Post new topic Reply to topic  [ 115 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8  Next
Minor things worth mentioning 
Author Message
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 383
Post Re: Minor things worth mentioning
Valve presented a way for rendering masked stuff without the odd jagged borders back at SIGGRAPH 2007.
http://www.valvesoftware.com/publicatio ... cation.pdf
The interessting point is, that in it's simplest form it can just be handled at resource creation time and just handled like ordinary alpha testing.

Might also be a way to just have the TTF-sampled fonts for the 1x resolution, which would still look good at 2x. At 3x it would in any case look better compared upsampled ordinary 1x or 2x bitmap fonts.

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Mon Jan 02, 2017 6:33 pm
Profile
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 383
Post Re: Minor things worth mentioning
Typically I would do such things as natives, but I just wanted to have sth. for quick testing.

Code:
// Makeshift Pow for X>0.
static final function float Pow( float X, float Y )
{
   return Exp(y*Loge(X));
}


Code:
static final function vector Compress_sRGB( vector Color )
{
   local vector Result;
   if ( Color.X<=0.0031308 ) Result.X = 12.92*Color.X; else Result.X = 1.055*Pow(Color.X,0.41666)-0.055;
   if ( Color.Y<=0.0031308 ) Result.Y = 12.92*Color.Y; else Result.Y = 1.055*Pow(Color.Y,0.41666)-0.055;
   if ( Color.Z<=0.0031308 ) Result.Z = 12.92*Color.Z; else Result.Z = 1.055*Pow(Color.Z,0.41666)-0.055;
   return Result;
}
static final function vector Decompress_sRGB( vector Color )
{
   local vector Result;
   if ( Color.X<=0.04045 ) Result.X = Color.X/12.92; else Result.X = Pow((Color.X+0.055)/1.055,2.4);
   if ( Color.Y<=0.04045 ) Result.Y = Color.Y/12.92; else Result.Y = Pow((Color.Y+0.055)/1.055,2.4);
   if ( Color.Z<=0.04045 ) Result.Z = Color.Z/12.92; else Result.Z = Pow((Color.Z+0.055)/1.055,2.4);                                     
   return Result;
}


/edit:
Turns out I missed the ** operator, so there is no need for the makeshift pow.

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Last edited by Hanfling on Sun Mar 12, 2017 1:00 pm, edited 1 time in total.

Sat Jan 14, 2017 4:54 pm
Profile
Thug

Joined: Tue Jun 26, 2012 3:32 am
Posts: 36
Post Re: Minor things worth mentioning
Hey Hanfling,

Thanks again for help guide me through working with native code.

I have just one question.


I have one single LNK2001 Error Which says this:

Code:
SampleClass.obj : error LNK2001: unresolved external symbol "public: virtual int * __thiscall AActor::GetOptimizedRepList(unsigned char *,struct FPropertyRetirement *,int *,class UPackageMap *)" (?GetOptimizedRepList@AActor@@UAEPAHPAEPAUFPropertyRet
irement@@PAHPAVUPackageMap@@@Z)



It seems to not have to do with the test function I am importing, but instead a function in the AActor class.

I have both Core.lib and Engine.lib linked with all the necessary headers.

I have researched this exact error with no avail, What would you say the problem is?


Thanks,
Brenden

EDIT: I fixed it, I was using old Core and Engine Libs... Downloaded the official DX ones, recompiled and voila.


Sat Jan 14, 2017 9:14 pm
Profile
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 383
Post Re: Minor things worth mentioning
I finally stumbled more or less by accident about some Maya/Max sample files for the ActorX exporter. Sadly I couldn't get the Maya example to open in Maya 2016 Extension 2 and sending over from Max screwed up the Mesh. However, opening the Max example with Max 2016 did work, so I ended up adding Deus Ex vertex mesh export to the Max ActorX plugin and successfully tested it. :) I also added the code to the Maya plugin, but I couldn't test it.

Source:
https://github.com/hanfling/ActorX

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Tue Jan 24, 2017 12:37 pm
Profile
Illuminati

Joined: Thu Mar 08, 2012 3:21 am
Posts: 2278
Post Re: Minor things worth mentioning
So we can export vanilla/HDTP DX meshes easy, edit it in max/maya, and then import it back in (using the usual import pipeline that never seems to bloody work)? Is that the purpose of this program?

_________________
GMDX: Advancement Mod


Tue Jan 24, 2017 1:01 pm
Profile
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 383
Post Re: Minor things worth mentioning
Well you still need SkeletalAnimation in Max/Maya to sample from. But yeah, thats the idea, getting rid of having manually sample, export to 3ds, run 3ds2unr/de, but instead directly export out of Max/Maya. However ActorX won't write you the uc file, so one would need to write down number of keyframes per animation. Would be worth to add some sort of support for an ini file, which gets purged if the animation is not appended, otherwise it should get updated and used to create some dummy/sample script file.

But I can't give a full blown user guide, I just have a few links here and there.

Other ideas are to support the ION style material syntax as supported by their lwo23d or how it was called. I liked it.
Yet another idea, and I would really like to get some testmesh in Maya is try to match the 8bit texture coordinates to the pixel center of (virtual) thought of 256x256 textures. At least that would work like a charme for legacy meshes. For the non animated low res meshes this would be a nice way to get the texture alignment straight...

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Tue Jan 24, 2017 2:34 pm
Profile
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 383
Post Re: Minor things worth mentioning
Turns out there is a 3ds import plugin for Maya as part of the Maya Bonus Tools package.

https://knowledge.autodesk.com/support/ ... -Maya.html
https://apps.autodesk.com/MAYA/en/Detai ... 2702393827

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Thu Jan 26, 2017 1:28 am
Profile
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 383
Post Re: Minor things worth mentioning
Just out of curiosity: Are there any (community made) Deus Ex packages with stripped ScriptText out there which would be in particular interessting to have the source for?

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Thu Feb 23, 2017 1:52 am
Profile
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 383
Post Re: Minor things worth mentioning
Code:
function TestEmptyWhileUntil()
{
   local int i;

   while ( ++i<10 )
   {
   } until( i>20 );
}

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Sat Mar 11, 2017 2:24 pm
Profile
Illuminati

Joined: Thu Mar 08, 2012 3:21 am
Posts: 2278
Post Re: Minor things worth mentioning
What's the purpose of this test? To see what happens when i iterates through 10-21? What is the result?

_________________
GMDX: Advancement Mod


Sat Mar 11, 2017 3:39 pm
Profile
MJ12

Joined: Thu Apr 02, 2009 7:55 pm
Posts: 440
Post Re: Minor things worth mentioning
It doesn't seem to do that? I only know C, but it seems like it initializes i without giving it a value - so i equals whatever value was in its memory address beforehand (junk value).
If i is less than 9, it'll count to 9.
otherwise, it'll terminate:
If it's larger than 9, it'll never enter the loop.
If it's larger than 20, it both will never enter the loop and even if it will it will encounter the termination condition, so... yay for redundancy?

I have no idea what purpose this code might have.


Sat Mar 11, 2017 4:43 pm
Profile
Illuminati

Joined: Thu Mar 08, 2012 3:21 am
Posts: 2278
Post Re: Minor things worth mentioning
No need to initialize variables in UScript, only declaration. It's beautiful. everything is defaulted to 0/false/none unless defined otherwise. Remember - no memory management. Has automated garbage collection.

But yeah, I was thinking since i defaults to 0 it will never have the chance to iterate past ten, but then I thought maybe it does via until, otherwise what would be the point in that parameter/condition? Consider us both stumped.

disclaimer: only used a while loop a few times, like the shotguns reloading one shell at a time. Despite my achievements and five+ years coding I'm still probably barely intermediate.

_________________
GMDX: Advancement Mod


Sat Mar 11, 2017 5:17 pm
Profile
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 383
Post Re: Minor things worth mentioning
Made in China wrote:
It doesn't seem to do that? I only know C, but it seems like it initializes i without giving it a value

As cypig pointed out, local variables are explicit zero initialized, instance variables are initialized by their default value (which is also zero by default).

I posted it more as sort of some: WAIT, WHAT, THIS COMPILES.

By pure accident, though that happened at the perfect time, I stumbled upon that these while-unil loops compile in UnrealScript. Before I thought that only for/while/do-until loops are possible in UnrealScript. while-until loops also seem to work in C++, but I have no idea about the speficis there, and no real interesst in figuring them out.

As for details about how the execution of the while-until, the following disassembly should shed some light on it. I probably later post some example with break or continue in. Especially how continue works in these while-until loops would be interessting (Offsets are relative to start of the function/rep/state, not relative to the instruction they are part of).

Code:
   //
   // 0x0000: EX_JumpIfNot (JumpOffset=0x001A)
   // 0x0003:   EX_Native (iNative=150,Function=Core.Object.Less_IntInt,OperatorType=1)
   // 0x0004:     EX_Native (iNative=163,Function=Core.Object.AddAdd_PreInt,OperatorType=2)
   // 0x0005:       EX_LocalVariable (Property=ScriptRaysTestPackage.ScriptRaysTestFunctions.TestEmptyWhileUntil.i)
   // 0x000B:     EX_IntConstByte (IntConst=10)
   // 0x000E: EX_JumpIfNot (JumpOffset=0x0000)
   // 0x0011:   EX_Native (iNative=151,Function=Core.Object.Greater_IntInt,OperatorType=1)
   // 0x0012:     EX_LocalVariable (Property=ScriptRaysTestPackage.ScriptRaysTestFunctions.TestEmptyWhileUntil.i)
   // 0x0017:     EX_IntConstByte (IntConst=20)
   // 0x001A: EX_Return
   // 0x001B:   EX_Nothing
   //


/edit:
Update for continue: continue jumps to the lower condition.

Code:

function TestEmptyWhileUntilContinue()
{
   local int i;

   while ( ++i<10 )
   {
      continue;
   } until( i>20 );

   //
   // 0x0000: EX_JumpIfNot (JumpOffset=0x001D)
   // 0x0003:   EX_Native (iNative=150,Function=Core.Object.Less_IntInt,OperatorType=1)
   // 0x0004:     EX_Native (iNative=163,Function=Core.Object.AddAdd_PreInt,OperatorType=2)
   // 0x0005:       EX_LocalVariable (Property=ScriptRaysTestPackage.ScriptRaysTestFunctions.TestEmptyWhileUntilContinue.i)
   // 0x000B:     EX_IntConstByte (IntConst=10)
   // 0x000E: EX_Jump (JumpOffset=0x0011)
   // 0x0011: EX_JumpIfNot (JumpOffset=0x0000)
   // 0x0014:   EX_Native (iNative=151,Function=Core.Object.Greater_IntInt,OperatorType=1)
   // 0x0015:     EX_LocalVariable (Property=ScriptRaysTestPackage.ScriptRaysTestFunctions.TestEmptyWhileUntilContinue.i)
   // 0x001A:     EX_IntConstByte (IntConst=20)
   // 0x001D: EX_Return
   // 0x001E:   EX_Nothing
   //
}

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Sun Mar 12, 2017 1:40 pm
Profile
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 383
Post Re: Minor things worth mentioning
I always had this mysterious bug in my OpenGLDrv, which was already in the ut436-opengldrv-src-090602 where the black background bars of the third person convervation windows had the wrong size.

Turns out, this was in the caused by a missing Frame->ComputeRenderSize() (which will invoke RenDev->SetSceneNode()) inside the XRootWindow::PostRender() after the original FSceneNode data was restored there, so RenDev never knew that it actually changed again. This wasn't an issue in SoftDrv nor D3DDrv as these directly use the data out of FSceneNode passed in along the drawcalls, while OpenGLDrv relied on getting notified of this (e.g. by the SetSceneNode() call). Sadly this SetSceneNode() stuff was later added to the Engine (it's missing in KHG) and seems to never have really been fully hocked in. There were SetSceneNode() calls missing in URender::DrawWorld() which are relevant especially for NearClip plane changes/and if you don't let C++ code in Render transform into Viewspace before handling it. Also there is one SetSceneNode() call missing after the drone window is drawn and I currently for DeusEx check if the passed in FSceneNode pointer changed in DrawTile, which works in this case, but isn't great either.

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Thu Jun 29, 2017 10:12 am
Profile
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 383
Post Re: Minor things worth mentioning
Yep, Viewport window misses a call to ComputeRenderSize() and hack to work around it is gone.

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Sat Jul 01, 2017 10:28 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 115 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8  Next


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forum/DivisionCore.