LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   Ahto Spaceport Cantina (http://www.lucasforums.com/forumdisplay.php?f=325)
-   -   Glintercept for kotor and tsl (http://www.lucasforums.com/showthread.php?t=211364)

Xarwarz 11-04-2012 04:33 AM

Glintercept for kotor and tsl
 
This could be sticked as a modders resource if the mods dont mind thanks.

I came across a program called glintercept for open gl applications. I decided to try it on kotor and tsl. Interesting enough it has a FREE CAM mode to fly around the levels also a shader editor. The shader editor from messing around with it seem to change the color and lighting of certain objects. Theres also a wire frame mode and the ability to dump textures shaders and frame buffers. I just sharing this in hopes that maybe one day a REAL-TIME LEVEL EDITOR can be made for both games. Anyhow check it out for yourself...PICTURES ON BOTTOM:thmbup1:

Link.....http://code.google.com/p/glintercept/

About GLintercept.

GLIntercept is a OpenGL function call interceptor for Windows that will intercept and log all OpenGL calls.

Basic usage
Select the version of GLIntercept right for the application being debugged (x86 or x64) - Note you select the version of GLIntercept based on if the application is x86 or x64 (64bit) - not if the operating system is 64 bit.

Then after installation, simply copy the opengl32.dll and a gliConfig.ini file from the install directory to the executable folder of the application you want to intercept OpenGL calls.

Then edit the gliConfig.ini file, enable the options required and then run the application.

How it works
GLIntercept works by overriding the call to wglGetProcAddress, wrapping the real function pointer in some assembly and then returning it to the application being debugged.

This means that when new OpenGL extensions/versions are released, GLIntercept will automatically log the new functions.

However, while all function names are automatically logged, function parameters need to be specified. These are supplied via text files in a "C" style syntax that can be updated as needed.

eg. void glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );

History
GLIntercept has existed since 2003 and was mainly designed as an OpenGL 1.0-2.1 debugger. So while basic function logging should work on all OpenGL versions, the more advanced features listed below may or may not work in OpenGL 3.0+. (especially when using a core OpenGL profile)

Features
Main GLIntercept features:

Save all OpenGL function calls to text or XML format with the option to log individual frames.
Activate and log ARB_debug_output messages to the log
Run time shader edit. Display shader usage and edit the shaders at run time. Supports ARB VP/FP/GLSL and NV VP/FP......To enable Shader Edit ctrl+shft+s
Free camera......ctrl+shft+c Fly around the geometry sent to the graphics card and enable/disable wireframe/backface-culling/view frustum render.........Wireframe my settings ctrl+shft+z
Save and track textures. (1D,2D,3D,NVRect and p-buffer bound textures are supported.) Saving can be to TGA,PNG and JPG formats......Dump frames,textures,shaders ctrl+shft+f
Save and track shaders/programs.
Save and track display lists.
Saving of the OpenGL frame buffer (color/depth/stencil) pre and post render calls. The ability to save the "diff" of pre and post images is also available.
Track error states (logging them to the debugger output) and breaking on errors.
Basic thread error checking.
Function timer log.
Resource leak tracking for contexts, display lists, shaders and textures.
OpenGL extension/version override. Add/remove/replace the OpenGL extension and version strings. (Test lower end rendering paths without changing cards)
OpenGL function stats - how many times each function is called.

MY INI SETTINGS.....

GLICONFIG.ini

Show spoiler


FREECAM.ini settings

Show spoiler





Show spoiler


Show spoiler


Show spoiler


Show spoiler


---------------------------------------------------------------

UPDATE 11-6-12

Heres a tool to extract levels out of kotor and TSL. If you need to covert the models you could use a converter like 3d object converter. Not shure if these would work in game after edit and conversion but its worth a try.

NOTE:This is slightly different from glintercept.....


This is the OpenGLXtractor Windows Tool!

With this tool, it is possible to Capture 3D Data from an OpenGL Application.

Like 3D Mesh, Textures,Shaders,UV's,....and more.


http://members.chello.at/alexan/


PICZ

Show spoiler


Show spoiler


Show spoiler

Sith Holocron 11-04-2012 05:22 AM

I am looking forward to what the KOTOR and TSL movie makers might do with this. I've just pointed the way to this thread.

Lord2 11-04-2012 07:32 AM

" Then edit the gliConfig.ini file, enable the options required and then run the application."

:raise:

What does this mean? What functions are required and how do you proceed next?

I read somewhere that the freecam is activated using ctrl, shift and C and i,j,k,l, or something, are used to move but nothing happened when I tried it.

And K1 goes into an unplayable state (a lot of lag)

Yceman 11-04-2012 10:12 AM

Quote:

Originally Posted by Sith Holocron (Post 2822492)
I am looking forward to what the KOTOR and TSL movie makers might do with this. I've just pointed the way to this thread.

Tested this out a bit on TSL, and for the most part, it does work. It is buggy in some places though so I'm going to play around with the angles and maybe even the config settings a little bit. Like the NWN camera angles not painting the sky lots of the time, some angles don't paint the entire background while others do (specifically, I noticed the shield wall on Telos, the pillars on Korriban, etc. disappear and reappear in spots). I've found about 4 different camera angles so far and you can adjust the height up or down however you like. I think I can make use of this program though and overall it does have a lot of potential. I'll be sure to play around with it when I get to the filming stage of my Episode V. Once again, great find and this is sure to improve my next two movies!

Sithspecter 11-04-2012 10:20 AM

That's pretty cool! Nice find.

Xarwarz 11-04-2012 11:27 AM

Quote:

Originally Posted by Lord2 (Post 2822496)
" Then edit the gliConfig.ini file, enable the options required and then run the application."

:raise:

What does this mean? What functions are required and how do you proceed next?

I read somewhere that the freecam is activated using ctrl, shift and C and i,j,k,l, or something, are used to move but nothing happened when I tried it.

And K1 goes into an unplayable state (a lot of lag)

Its a little confusing at first.

1. Download the 32 bit version of Glintercept...32 bit is for the application type not windows version.

2. Then after installation, simply copy the opengl32.dll and a gliConfig.ini file from the install directory to the executable folder of the application you want to intercept OpenGL calls...I used the gliConfig_AuthorStd.ini then renamed it to gliConfig.ini this ini file has the best settings.

3. You could edit the free cam ini found in the plugins folder from the glintercept install directory. I have an example below....basically i changed wireframe mode to ctrl+shft+z and camera movement to w,s,a,d.

To enable free cam ctl+shft+c

FreeCam.ini

Show spoiler

Lord2 11-04-2012 12:02 PM

Thanks, this is really an awesome discovery. I also advise people go check the gliconfig.ini and disable the different type logging - I was playing around a minute and after I had a 8gb log file and like two subfolders (images and shaders)

Just change most "Enablelogging: true" to false or something. It was a big help to the framerate.

JCarter426 11-05-2012 02:18 PM

I've tested the camera function a bit:

View page
YouTube Video
View page
YouTube Video
View page
YouTube Video
View page
YouTube Video
View page
YouTube Video

As I mentioned in the video description, there are clearly a few problems. As far as the game is concerned, the camera hasn't changed; this causes a discrepancy between what the game renders and what you actually see. This has confirmed some of my suspicions regarding the way the game's rendering engine works. The area models of the room you are in are always rendered, for the most part; however, any creatures, doors, or placeables that you are not looking at directly aren't rendered at all, and the other rooms seem similarly dependent on your player's perspective. You can trick the game into rendering more by messing with camerastyle.2da but even this is limited.

Still, what it can do is rather rather handy. And I'm sure by testing with it further, we can resolve some of these issues. Excellent find!

Yceman 11-05-2012 06:37 PM

Nice clips, Carter. That's about what I encountered as well, but you stated it much more elegantly....and posted some video :)

It has potential and I'm looking forward to playing around with it some more.

JCarter426 11-05-2012 07:08 PM

I also noticed some textures are not rendered properly; they seem flat, don't move with the model... reminds me of Stan from Monkey Island. I don't believe it's a problem with the actual texture files, as it doesn't seem to affect all instances of that texture, and swapping out the texture doesn't fix it. It seems like it should be a shader issue, except some shaders work fine, and not every texture affected is even using a shader. Odd.

Xarwarz 11-05-2012 09:48 PM

Nice vid demonstration when i discovered this it didnt dawn on me the movie concept...but the cams too ruff around the ends..im researching how to make new plugins for this...

JCarter426 11-08-2012 03:17 PM

Well, I've been working on a film project for a few years now. Mostly I've used AniCam, but GLIntercept is quite handy for being in real time. The movement is a lot smoother in conjunction with a gamepad.

Darth Avlectus 11-09-2012 07:30 PM

I like this thread.

Yceman 11-09-2012 10:50 PM

Quote:

Originally Posted by JCarter426 (Post 2822783)
Well, I've been working on a film project for a few years now. Mostly I've used AniCam, but GLIntercept is quite handy for being in real time. The movement is a lot smoother in conjunction with a gamepad.

JC, I didn't want to skew any creativity when working on my Episode IV, but now that it's finished, I decided to finally check out your Peragus clips. You've got some real skill my man and I'm really looking forward to your project. Re-creating the Peragus events from the holovids is brilliant. I actually pondered something similar when considering my own version for my film, but after seeing your clips, I'm glad I didn't go in that direction since you'd have put mine to shame! I assume AniCam is how you accomplished some of the great camera work. I played around with it some but could never get the hang of it, definitely not in the same way you've seemed to have mastered it. I'm hoping to use GLI now to give my next two movies some more flavor. Anyway, just thought I'd share. Really digging GLI, so once again, great find Xarwarz!

JCarter426 11-18-2012 08:38 AM

Oh, thanks. Yeah, it's AniCam... and it is a challenge. It's good for large, sweeping motions, but anything that requires speed or precision is really tricky if you're doing it manually. GLIntercept is better in those areas because it has the advantage of being in real time. There are some drawbacks, however; most importantly, it lacks repeatability. If you make a mistake, you must start over from scratch. You also can't seamlessly combine two shots. In that respect, AniCam much resembles the Steadicam used for the special effects in the original trilogy. GLIntercept is your handheld model, good for quick and dirty action shots.

JCarter426 12-06-2012 08:58 PM

1 Attachment(s)
Since other people had trouble with the logging, here's my configuration file with all the logging removed, so you don't have to waste time hunting down everything. You'll need to rename the TXT to INI (because LF won't let me upload INI) and put it in the main directory of whatever game you want.

Xarwarz 12-07-2012 07:52 PM

Cool that should make it easy for a new person to get into it

Quanon 12-08-2012 03:07 PM

Quote:

Originally Posted by JCarter426 (Post 2822584)
This has confirmed some of my suspicions regarding the way the game's rendering engine works. The area models of the room you are in are always rendered, for the most part; however, any creatures, doors, or placeables that you are not looking at directly aren't rendered at all, and the other rooms seem similarly dependent on your player's perspective. You can trick the game into rendering more by messing with camerastyle.2da but even this is limited.

Editing the .vis and .lyt file of a game area could solve some of these "problems'. Within both these files the game gets info on what parts of the whole area need to be rendered. Both files contain basicly a list of the differant rooms an area is made of. Plus each room gets a list of its own, saying what needs to be rendered if the player is within said room.

example of how it looks.
Code:

RoomA 3
 RoomB
 RoomC
 Sky
RoomB 3
 RoomA
 RoomC
 Sky
RoomC 4
 RoomB
 RoomD
 RoomE
 Sky

Though, you might still have problems regarding the rendering of creatures, placeables etc... I believe these are depended on other settings, propebly hardcoded.

Nice find though, it certainly will help the modding community. It beats the sluggish slow work of compiling and puzzling stuff together in 3Ds Max.

JCarter426 12-08-2012 03:38 PM

Yeah, the area geometry isn't much of a problem. For the most part it all loads fine, with a few minor exceptions that editing the VIS file wouldn't help anyway because it's already set up correctly; the game just doesn't know what it's looking at, so it doesn't render it.

DarkWatcher 10-13-2014 08:54 PM

I am having lots of fun with this! I had the Xbox version of KOTOR, but then I gave my Xbox away. I later found out about the free cam feature, and at that moment I wanted my Xbox back! But now that I came across this, I am very happy! Thanks for this awesome discovery :D


All times are GMT -4. The time now is 04:10 PM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.