Car simulation effects

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

Code: Select all

http://www.mediafire.com/file/xmoyzymtemm/db9.zip
Theres some issues with the exporter you are using> i exported from blender, try this one in your shaders (dont worry bout the materials yet).

ALSO, the mesh is extremely high poly depending on the game you are doing.

Image
Image
Image
Image
Image

The normals are fine (thats the file iv uploaded)

:D:D
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Are you sure the reflection isn't inverted? You should be able to see the red box in the reflection in the last shot. Trying inverting the normals vector in the shader and see how it goes.

EDIT:

See with the original demo I sent you:

Image

You can see the rock's reflection in the bonnet (Circled in red).
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
lulzfish
Posts: 34
Joined: Sat Aug 15, 2009 8:19 pm

Post by lulzfish »

yeah, in the last few shots, the sky is reflected on the bottom side of the car, and the top is dark from reflecting the ground.

I think something is backwards there.
Is the somber dream of the Grim Reaper a shade Darker Than Black?
aux
Posts: 10
Joined: Wed Aug 19, 2009 7:03 am
Location: Russia
Contact:

Post by aux »

FuzzYspo0N, reflection is wonderful! =)
but I also think it is inverted. A car chassis isn't a transparent sphere and a common user expects to see a sky reflection on the top side :)

Anyway, it's really kewl.
I wish i could do anything alike...

BlindSide, thank you also for your work
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

I have been adapting and adjusting it over time, and i am just about finished fixing it (the render order is weird atm)

I will post this as soon as iv fixed it
and also mentioned repeatedly on my blog :) Thanks for the hint blindside, but i was rewriting the reflection as an IMaterialRenderer and during the process iv switched a good number of shader code with my own now, so the problem actually is the "front" and "back" are mapped on the wrong side (that also affects the Eye vector in the shader). Though i did try swithcing the Normal vector, it makes the "horizontal" reflection inverted... Ie im on the left, the reflection of me is on the right side of the cube.

Im fixing it, lol Thanks for the hints.

Also aux, Did that car work in your shaders? ? Thats the reason i was posting
aux
Posts: 10
Joined: Wed Aug 19, 2009 7:03 am
Location: Russia
Contact:

Post by aux »

FuzzYspo0N, yes now it has smooth colors on the surface. Thanks for finding the reason of the problem.

But the .obj file loads much slower than the .x file, so i'll try to convert it with different tools to an .x format. But, most likely, i'll have this problem always when convert the model to .X

BTW, i still haven't made any suitable shader work, so if you have some examples of a little more 'advanced' shader (rather than 'plastic' :)) with the source code, could you please share it for me, if that's not too much trouble?
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

looks like the vectors are inverted, at least, the up down vectors. Working with reflections is confusing, as, if your normal points up, it reflects what it is upside, but actually, the camera is looking down! and that's confusing XD
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

Hey, this is almost finished as an IMaterialRenderer, meaning you can apply it like the EMT_MATERIALTYPE :)

That way you can dissect it as much as you like.

More images here : http://irrlicht.sourceforge.net/phpBB2/ ... 516#203516
aux
Posts: 10
Joined: Wed Aug 19, 2009 7:03 am
Location: Russia
Contact:

Post by aux »

Waiting for the moment when i could get it in my hands :D
Post Reply