Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Vehicles with Fulcrum Physics

Author
Message
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 26th May 2010 04:14 Edited at: 26th May 2010 04:19
Hi, just finished a vehicle demo, exe attached. Let me know if you have any issues, thanks.
I've made a new thread as I hope to put more vehicle examples up here, if anyone else ever does anything good with vehicles and has any tips then post here with a pic, thanks.

VIDEO




If the exe does not run for you, you may need the NVIDIA drivers, its about 30Meg(I think) but once you have it you can play any game that uses PhysX.

Here's the code:


Attachments

Login to view attachments
haliop
User Banned
Posted: 26th May 2010 10:39
Well done!
however i thought you would go for a 4X4 to see the wheels going up and down ..looking good man! and that car is good , where is it from?
haliop
User Banned
Posted: 26th May 2010 11:11
btw , i thought about a way to implent static shadows witht he lightmap baking as in the demo but on the actuall dynamic shadow object like the car.

it does require some calculation, but i'll show you a picture of what i meant and maybe will build it using the current code.



the problem is if we use exteriror editors we need to know their scripting languge in order to write a script to build as these meshes as limbs , where each of that limbs will be named Shadow_Idnumber, then writing a small solution inside DarkGDK wont be that much of a problem i guess i will check it now.

but if we do it inside DarkGDK , like a Pixel-Perfect Static lighting it shouldnot be that much of a problem , you take the light source for direction angles and positions and you make it sirth of a camera or something then calculating the vectors and checking for pixels which are darker then they should look , im not much of a math guy so it will be a problem for me to accomplish. however if we have a system that does this , we will get a very high ligthing detail over Dynamic Objects without the use of Dynamic Lighting at these areas.

i'll try to demonstrate how it should work
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 26th May 2010 12:02
The car is from the dark matter models you get free with GDK.
Yeh, you don't need dynamic lighting for static objects really, unless you want day/night cycles. So you could raycast from where the sun is to see if the object/limb should be lit is visable from the sun.

haliop
User Banned
Posted: 26th May 2010 14:46
i want the car to be shadowed where the static shadow is.
haliop
User Banned
Posted: 26th May 2010 22:26 Edited at: 26th May 2010 22:40
Quote: "Yeh, you don't need dynamic lighting for static objects really, unless you want day/night cycles. So you could raycast from where the sun is to see if the object/limb should be lit is visable from the sun."


im thinking of something more accurate and less CPU Usage,
take a look at the picture , see the boxes? or the triangle?
think of that as a "Hidden" triangle that once you enter it if its just a part of the object or whole of the object you get darker, so the triangle for example is just a Triangle with a Black Texture attached to it with alpha of 255(full alpha) */-+ LightSource.Ambient
depending of the LightSource.Ambient configuration , once the texture is set there is no more Calculation required , altough will need to check how much Alpha takes from the GPU, but think of it as a free calculation since its just there no raycasting or anything else.

btw, i cannot run the Code you posted here , probably since you use a newer version of fulcrum.
i will just try it as the TestMap with a Sphere or something...

edit: i see a problem with this, since if you will look from the side you will see a half transparent black triangle in that case in others you will see a box.. or whatever mesh it will be.. hmm i need to think about it more. i will check for examples on how other ppl got baked shadows to shadow an object..
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 26th May 2010 23:07
You will need the unofficial update on the last page to run the code, official update will be released soon.

Raycasting is not that expensive, per pixel raycasting is but that is not needed. You just send one raycast from the light source(pretend light source) toward the object, if it hits the object first then you know to light it, if not, turn the object light off.

This is an easy/cheap solution, your object would never be half in light and half in shadow, you would need a shader for that I would think.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 27th May 2010 00:58
OK, I've been messing about with other vehicles and they are not all as straight forward as this one. I'm just talking about the free ones you get with GDK.
The motorbike works fine and the F1 car, the stock cars wheel limbs are set up a little strange, the wheels turn about the Z-axis instead of the X-axis which just does not work with Fulcrum.

If you setup a vehicle and the wheels are rotating strange then the best solution may be to remove them altogether and add your own wheels as limbs. I need to try this myself to make sure it works otherwise the vehicles will be limited.

JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 27th May 2010 05:23
Quote: "Raycasting is not that expensive, per pixel raycasting is but that is not needed. You just send one raycast from the light source(pretend light source) toward the object, if it hits the object first then you know to light it, if not, turn the object light off.

This is an easy/cheap solution, your object would never be half in light and half in shadow, you would need a shader for that I would think."


I've never dealt with lighting/shading, but can't we set a light's color? If so, why not have a light that hovers over the car (in much the same way as we move the camera) and set its color to grey (or some-such) shadow color? Certainly we can turn the light on / off at will (the GDK demo does) when we enter the Triangle / boxes above...

IDK, it may be a bad idea (i think GDK only supports 7-lights). But it seems to me that it would work...

JTK
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 27th May 2010 22:06 Edited at: 27th May 2010 22:06
Quote: "why not have a light that hovers over the car (in much the same way as we move the camera) and set its color to grey (or some-such) shadow color? Certainly we can turn the light on / off at will (the GDK demo does) when we enter the Triangle / boxes above..."


Yeh this works great, the best way to emulate a light source which is an infinite distance away(sun) is to just reposition the light relative to the object, the problem is when there are other objects near by.

Turning the ambient light off for that object works well when it goes out of sight of the sun. I don't think haliops idea of noting down triangles and boxes where the object should go dark is the best way to do it. One raycast from the sun to the object will tell you that straight away without any extra work

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 27th May 2010 22:56

Login to post a reply

Server time is: 2024-07-07 00:18:05
Your offset time is: 2024-07-07 00:18:05