www.tombraiderforums.com

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Software Development

Reply
 
Thread Tools
Old 16-05-14, 19:46   #591
AdenClements
Historian
 
AdenClements's Avatar
 
Join Date: Mar 2013
Location: Natla's left breast
Posts: 293
Default

It's now working for me! Yey!

However, when I get in, I try to use WASD to move Lara, however the camera just zooms in on her


Am I being dumb? :3
__________________
Drink too much from a bottle marked 'poison' it is certain to disagree with you
AdenClements is offline   Reply With Quote
Old 16-05-14, 21:05   #592
Dustie
Relic Hunter
 
Dustie's Avatar
 
Join Date: Apr 2005
Location: Poland
Posts: 9,181
Default

It's still not working for me. I'm not getting an error anymore, but when I try to run the exe nothing happens now, it just sits there in the Program Manager.
Dustie is offline   Reply With Quote
Old 17-05-14, 08:31   #593
Ado Croft
Historian
 
Join Date: Apr 2013
Posts: 265
Default

Quote:
Originally Posted by AdenClements View Post
It's now working for me! Yey!

However, when I get in, I try to use WASD to move Lara, however the camera just zooms in on her


Am I being dumb? :3
Well, open your config.txt and slide down, when you get to the end of this page, change freelook from (1) to (0)
Ado Croft is offline   Reply With Quote
Old 17-05-14, 15:29   #594
AdenClements
Historian
 
AdenClements's Avatar
 
Join Date: Mar 2013
Location: Natla's left breast
Posts: 293
Default

Quote:
Originally Posted by Ado Croft View Post
Well, open your config.txt and slide down, when you get to the end of this page, change freelook from (1) to (0)
It is on (0), it's not freelook - that's the ability to move the camera around the scene: In this the camera just focuses around Lara
__________________
Drink too much from a bottle marked 'poison' it is certain to disagree with you
AdenClements is offline   Reply With Quote
Old 18-05-14, 22:10   #595
vobject
Hobbyist
 
vobject's Avatar
 
Join Date: Nov 2013
Location: Germany
Posts: 40
Default

Quote:
Originally Posted by Lwmte View Post
I don't think that currently I have time to do research on this, so I will ask TeslaRus to give you permissions to main repository, so you can get everything up and running!
Is there news regarding repo access for nightly builds?

PS: the recent changes to rendering look really cool btw.
vobject is offline   Reply With Quote
Old 19-05-14, 15:06   #596
Saracen
Hobbyist
 
Join Date: May 2014
Posts: 11
Default

Hi all,

I've started working on my implementation for movable object lighting. There's already a commit I pushed to my repository which gives moving objects ambient lighting sampled from the room they're in, along with some other fixes. What I'm working on now is the much more complex task of giving moving objects the correct directional lighting. In the interest of prototyping and iteration, I'm currently building my implementation using GL_LIGHTs. If I'm correct, this implementation should easily be adaptable to dynamic lights, too. The challenge is mainly figuring how to map the original's falloff values to GL_LIGHT's attenuation values. The Last Revelation onwards used a significantly more complex structure for room lighting information, so I'm starting with that and working my way down. One weird issue I'm encountering however is that the centre of the light seems to be coming off from slightly off to the side of where it should be.

Regarding some of the console-specific reflection effects mentioned in the thread, their omission in PC versions seemed to be due to them being an effect which the Playstation probably had graphics hardware specifically built for. They were probably either too slow or complex to recreate in the original's software renderer (can't remember how it looked on the Glide path), and TR2 onwards had hardware accelerated paths which were built on fixed-function Direct3D, meaning they wouldn't have had access to the pixel shaders necessary to recreate those effects. Similar effects might be possible in fixed-function OpenGL due to the availability of vendor-specific extensions, but I really don't know. This is probably one of the reasons to consider a shader-based OpenGL path in future. However, because OpenGL 2.0+ are programmable pipelines where you have complete control over the vertices and pixels in the hardware, it means you lose access to states like GL_LIGHT and GL_FOG; you have to write it all yourself from scratch, meaning a lot would have to be rewritten. I would also still support retaining the fixed-function path for the sake of legacy hardware, though.

Quote:
Originally Posted by Lwmte View Post
Yeah, I thought about it; we also talked with TeslaRus recently about lighting in original TRs... I knew nothing about 3D lighting beforehand, so it was revelation to me that old TRs never used actual room lighting in the first place, everything was done by modifying vertex colours (although I saw "CreateD3DLight" debug string in TR4 binary, I suppose it refers to room directonal light that only affects Lara) - correct me if I'm wrong!
Quote:
Originally Posted by Lwmte View Post
Sure, it's the best way for now, as we're only recreating basic things from classics at this moment! There's still things to be done - like implementing transparency for static meshes / movables, environment mapping (like in TR4-5) and shadows.

But I have a question regarding dynamic lighting... If I understand correctly, you can have only limited amount of simultaneous lights (8). On the other hand, there could be situations in game, which involve more than 8 lights in a scene (for example, five flame emitters, two dropped flares on the floor, Lara firing a gun, grenade exploding somewhere - and we already have nine dynamic lights). I suppose, in classic TRs is was done by "emulating" dynamic lights in the same manner as static lights? Maybe it was okay in 90s, but I wonder how it is done today - if not with deferred shading, then how else? Emulating dynamic lights with vertex colours just seems too difficult to implement to me!
Likewise, I have to admit that I know next to nothing about any version of Direct3D, aside which versions introduced which features, and most of my OpenGL knowledge is a theoretical. Adding lighting to this is actually very good practice for me. However, I imagine that fixed-function Direct3D, which four out of five of the classic Tomb Raiders used, offered convenience features comparable to fixed-function OpenGL, similar to GL_LIGHT and GL_FOG, meaning my implementation should be an appropriate analogue for the originals. Likewise, fixed-function OpenGL also has a default specification of 8 GL_LIGHTs per vertex. You would unlikely use this many, though. You would probably figure out which lights were mostly affecting a given object and omit the rest.

The lighting system that classic Tomb Raider used was clearly a product of its era and target platforms. Nearly all 3D games of this era would have used at least some form of baked-in lighting for static geometry. One of the reasons why vertex colours worked and was mostly good enough to at least get the job done in the original Tomb Raiders were because of the levels being a uniform grids of densely packed polygons, meaning significant memory saved compared to Quake-style lightmaps. This also worked for creating cheap dynamic lights in the later games. Since there's been a couple of custom levels being made nowadays where the designer will take a prebuilt grid level and build arbitrary shaped rooms in an external program, I imagine that they run into the kind of lighting issues you described. A per-pixel lighting scheme for dynamic lights could be a viable solution to this down the line; and yes, a hybrid rendering solution would indeed be possible, but I think it should be a long-term goal and I would probably favour doing a conventional forward rendering solution rather than deferred rendering, since that technique might cut off a lot of lower-end devices (Android port, anyone?)

Last edited by Saracen; 20-05-14 at 08:31.
Saracen is offline   Reply With Quote
Old 19-05-14, 15:12   #597
Ado Croft
Historian
 
Join Date: Apr 2013
Posts: 265
Default

OMG, can wait to see moveable lighting in that engine
Ado Croft is offline   Reply With Quote
Old 19-05-14, 15:22   #598
Dustie
Relic Hunter
 
Dustie's Avatar
 
Join Date: Apr 2005
Location: Poland
Posts: 9,181
Default

Quote:
Originally Posted by Saracen View Post
Since there's been a couple of custom levels being made nowadays where the designer will take a prebuilt grid level and build arbitrary shaped rooms in an external program, I imagine that they run into the kind of lighting issues you described.
This is interesting. I haven't heard of any reports from Meta2TR users of room lighting problems, while I have heard (and seen) that it's a way to overcome the engine's general issue with the room lighting not affecting static objects (as you can embed objects into the room grid, so that they're affected by the room lighting). From what I understand here, the lighting used in TR was never real, dynamic lighting, it was only a form lighting "effect" created by colouring polygons? But it was still generated in real time, at least in part, considering light effects such as flares, gun flashes or the bike light?
Dustie is offline   Reply With Quote
Old 19-05-14, 15:31   #599
Gh0stBlade
Archaeologist
 
Gh0stBlade's Avatar
 
Join Date: Dec 2010
Posts: 2,170
Default

Hi Saracen, I checked your latest changes yesterday and it was just amazing!

I was experimenting with water color manipulation. Have any of you folks checked out TRN? It seems they managed to get underwater moving light effects similar to what is used on the original games.

I tried to look into implementing this but it appears that they are using shaders?

Code:
void main() {
	vec3 pos = position;

	vUv = uv * offsetRepeat.zw + offsetRepeat.xy;
	vColor = color * tintColor * mix(vec3Unit, mix(vec3Unit, flickerColor, step(0.75, rnd)), flags.y);

	float sum = position[0] + position[1] + position[2];
	float time = curTime * 0.00157;

	// perturb the vertex color (for underwater effect, for eg)
	float perturb = 0.5 * abs( sin(sum * 8.0 + time) ) + 0.5;
	vColor *= mix(1.0, perturb, flags.x);

	// perturb the vertex position
	pos.x += mix(0.0, 8.0 * sin(sum * 10.0 + time), flags.z);
	pos.y -= mix(0.0, 8.0 * sin(sum * 10.0 + time), flags.z);
	pos.z -= mix(0.0, 8.0 * sin(sum * 10.0 + time), flags.z);

	vec4 mvPosition;
	mvPosition = modelViewMatrix * vec4( pos, 1.0 );
	gl_Position = projectionMatrix * mvPosition;
}
What do you folks suggest?
__________________
Link removed. I appreciate why, but the rule applies to everyone.
Gh0stBlade is offline   Reply With Quote
Old 19-05-14, 15:32   #600
Dustie
Relic Hunter
 
Dustie's Avatar
 
Join Date: Apr 2005
Location: Poland
Posts: 9,181
Default

What's TRN?
Dustie is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 23:33.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.