Log in to check your private messages 

RBR by night, working beta Post new topicReply to topic 
Forum Index  -> Richard Burns Rally -> Mods -> RBR by night, working beta
Page 3 of 3 Goto page Previous  1, 2, 3  
 Giorgio262
 
 

  italy.gif
 Joined: 10 Oct 2006
 Posts: 380
PostPosted: Fri Oct 27, 17:48 Reply to topicReply with quote
I'm yet to see a single picture that makes me want a night mod, and quite frankly I don't see why anybody would want it.
As far as I could see, to drive, at best, you just see darkness and the close objects lightened pretty badly, without any decent shadow. That is not nice to look at at all. Just as much as I didn't like it in CMcR 1 and then in RC2000. Then, even replays are not nice to look at. So as long as night sim is this rudimental I don't see any use for it. You may get excited about the idea, but the thing itself is nothing to make RBR any better.
 

 Back to top

View user's profileSend private message
 black f.
 
 

  un.gif
 Joined: 10 Apr 2005
 Posts: 901
PostPosted: Fri Oct 27, 17:53 Reply to topicReply with quote
is imposible to create dynamic shadows, the graphic engine needs to be rewrited for that, thats way beyond my knowledge.

i'm sorry Giorgio262, i've tryed my best but don't worry it will not happen again.

beside whats the point, there are alot of racing games around with night mod and dynamic shadows, feel free to choose Wink
 

 Back to top

View user's profileSend private message
 Jim B
 
 

  uk.gif
 Joined: 08 May 2005
 Posts: 261
PostPosted: Fri Oct 27, 19:41 Reply to topicReply with quote
Thank you for that comment Giorgio262, very helpful, and constructive, I'm sure it really inspires Frank. Confused If you've got nothing constructive to say, don't say anything at all. Mad

Its fantastic to have this mod in RBR. Are you still working on this mod Frank?

Regards,

Last edited by Jim B on Mon Oct 30, 12:05; edited 1 time in total
 

 Back to top

View user's profileSend private messageMSN Messenger
 black f.
 
 

  un.gif
 Joined: 10 Apr 2005
 Posts: 901
PostPosted: Fri Oct 27, 20:19 Reply to topicReply with quote
thanks Jim, unfortunately is no easy.

what pushed me to get this mod so far was the fact that it wasn't done b4, at least i didn't seen a shader mod for any other game yet, so it was some sort of "nerdy" ambition Very Happy and i think it ended pretty well, much better then i expected, so no, childish remarks wil not spoil it, but there will be no update for it, i really don't see what can i do to make it better.

what will make me really happy is to see somebody else getting involved in such modding, and if that will happen i'll be here to help, i hope Wink
 

 Back to top

View user's profileSend private message
 guybo
 
 

  usa.gif
 Joined: 01 Dec 2004
 Posts: 480
PostPosted: Sat Oct 28, 00:12 Reply to topicReply with quote
Actually Giorgio, you are talking out your ass. It's not my habit to defend Black F. but this is a promising mod if it can be made so as to not kill the FPS and somehow be integrated into the game or perhaps RSRBR3 it will be a great additin to RBR. Have you ever tried the night mod, Giorgio? To play RBR at night (no shadows and all Rolling Eyes ) is like playing a totally new game but with the same awesome RBR physics and cars. Before you speak, try it out.
 

 Back to top

View user's profileSend private messageYahoo MessengerMSN Messenger
 black f.
 
 

  un.gif
 Joined: 10 Apr 2005
 Posts: 901
PostPosted: Sat Oct 28, 14:05 Reply to topicReply with quote
what do you mean with integrated in game? detail that a little maybe there is something which can be done.
about the RSRBR, this night thing is independent from content so it should work with that modpack.
 

 Back to top

View user's profileSend private message
 szszp
 
 

  canada.gif
 Joined: 07 Oct 2003
 Posts: 951
PostPosted: Sat Oct 28, 18:05 Reply to topicReply with quote
Night mode looks amazing, despite the performance drop. It makes me wonder why the original developers didn't include this feature...
 

 Back to top

View user's profileSend private message
 stenyak
 
 

  spain.gif
 Joined: 04 May 2003
 Posts: 883
PostPosted: Mon Oct 30, 00:56 Reply to topicReply with quote
szszp wrote:
Night mode looks amazing, despite the performance drop. It makes me wonder why the original developers didn't include this feature...
The problem is not being able to, but having the time and money. Of course they could have included this and many more things (like tire wear or wings for example).
_________________
For simracers, by simracers - MOTORSPORT
Richard Burns Rally Wiki - RBRWiki
_________________ STK
 

 Back to top

View user's profileSend private messageVisit poster's websiteMSN Messenger
 black f.
 
 

  un.gif
 Joined: 10 Apr 2005
 Posts: 901
PostPosted: Mon Oct 30, 09:11 Reply to topicReply with quote
the answer is in the question: performance drop on outdated video cards,
at the time rbr was writted (don't it mix with the release date), almost all the cards available were outdated for speedy per pixel lightning.
 

 Back to top

View user's profileSend private message
 Flagmo-T
 
 

  denmark.gif
 Joined: 28 Nov 2005
 Posts: 571
PostPosted: Sun Feb 18, 02:31 Reply to topicReply with quote
Wow Thanks..


Black_F You are a truly creative Coder, this is amazing what you have done here, so creative and visionary, and yet, it shouldn't have bin possible, but you found your way .. Applause.. Cool

BTW: I actually don't feel any drops in FPS, I've even recorded a nice quality AVi from The tanner stage with fps in size 800x500 , and with Tommi hervela behind the wheel.. It's smoking

It's damn fast and it's quite real in the inside view, But on the full follow cam it's not all the time, so amazing in the view, But still workable in a Video post production, there is some amazing views in it, that would give a RBR Video some nice Car follow Cuts..

Ps. I'm Using Nhancer on a

Asus A8N-sli_Premium.
Amd +4200 Dual CPU.
Club3D7950GTX. "split to 2 screens, only when side running RBR"
3 GB pc3200 Geil.
Sata system.

Monitors:
Phillips brilliance 109p4 19".
Sony Bravia 32" LCD.
- - - - - - -
When the Night mod is installed.

Q. Have The tracksettings.ini any priority on the light/weather/car/particle/ settings of the map/stage ?

?. I Would like to have more control over the track settings, if possible .....(video)

Q. Would it be possible to have a Moon that smoothly light's up the map, and wouldn't it fade out the black artifact around the light corn ?

?. To balance to light setting between the Mod and the overall landscape.
.....(Video)

Q. Where do i go, when i want to lower the inside car light, and the front hood ?

?. It would look even more real, from the inside view.
.....(Video)

Q. Would it be possible to have the rear lights giving same light effect, just smaller of course..

?. (Video)

Q. What about the staff, any controls over there light ?

Q. Can i Have yellow light instead ?

Q. Is adding a little fog possible ?


(Sorry where else to ask these Questions.)


I'm settling for a early Morning Video type, That i think would be the best view overall, when making a HQ Video with the mod installed, That is if! adjusting is possible. Otherwise i go for the second best.. No worries Smile

- - - - - - -

I need to ad, that when having the Night mod installed, and Driving a Rainy stage inside view, the windshield is one amazing piece of work, I suddenly see it, i haven't seen it like that before .. Wow i say.. Smile


Thanks Black_f
Amazing Work.

Regards
Flagmo-T
_________________
Deep in my mind i believe everything is possible - https://www.flagmo-t.com/ Is my Richard Burns rally playground.
 

 Back to top

View user's profileSend private message
 black f.
 
 

  un.gif
 Joined: 10 Apr 2005
 Posts: 901
PostPosted: Sun Feb 18, 04:32 Reply to topicReply with quote
whoa, thanks! actually i was looking for some input from you since you have a monster system there for quite a while Smile

the in game controls are as readme says, not much but you can do alot more customisation by editing the shader files which are txt.

in example the "spot.h"... this is a function shared by several shaders.


Code:
float spot(   float3 vertPos,
         float3 lightPos,
         float3 lightDir,
         sampler attenuationMap,
         float range)
{
   float3 v2l = vertPos - lightPos;
   float distance = length(v2l);
   float attenuation = 0.2;
   float angle = dot(normalize(v2l), - lightDir);

   if(angle < 0)
   {
      attenuation = 0.2;
   }
   else
   {
      float2 uv = float2(angle, distance/range);

      float4 intensity = tex2D(attenuationMap, uv);
      attenuation = intensity.x;
   }
   return attenuation;
}



basically :
starts with calculating 2 things:
1: the angle between the light's central ray (light direction) and the imaginary line between the "mesh point" and light position, this angle is used to determine if the point is inside cone of light or not.
2: the distance between the point and the light, this distance is used for linear atenuation calculation.

this 2 are done with:
Code:

   float3 v2l = vertPos - lightPos;
   float distance = length(v2l);
   float attenuation = 0.2;
   float angle = dot(normalize(v2l), - lightDir);


is not much to change here, but further you can change how angle and distance
are influencing the result.

there are atleast 2 ways to do a spot like attenuation, or better say lightning calculation:

one is pure mathematical which involves formulaes you can find on web or made up Smile, the other is to use textures.

the texture way is used in that spot.h, more precisely, the angle and distance values are used to calculate a point (a pixel) location in the "test.dds".

with this position calculated by :
Code:
float2 uv = float2(angle, distance/range);

the color of the pixel from texture is readed
Code:
float4 intensity = tex2D(attenuationMap, uv);


"float4 intensity" is actually a color, 4 values in fasion RGBA, A being alpha, like:

intensity.x = RED
intensity.y = GREEN
intensity.z = BUE
intensity.w = ALPHA
worths mentioning tha you can use r,g,b,a instead of x,y,z,w.

all four values are in a 0.0 to 1.0 range, matching the 0 - 255 range as in photoshop color picker;


the
Code:
attenuation = intensity.x;

takes only the red component of the pixel from texture and returns it as the function ends.

i used this "texture lookup" aproach because is more easy for most of the moders to obtain different spot lights behaviours by simply changin a texture in photoshop instead of messing with code.
as a quick note, as readme says:
-test.dds controls the light intensity, so in case you want your own map:
horizontal - maps the intensity of light in raport with angle;
vertical - intensity map for distance;


on a higher lever there are the pixel shaders which are making use of this function.
in example the one from PS_16.h.

if you cant make a yellow light in spot.h because as it is it calculates a factor of attenuation wich is the same for all 3 channels, and for some reason you dont like to do it by changing the [COLOR] in "light.ini", then the shader is the place you can do it.

in example, in PS_16.h:
after
Code:
outColorA.xyz *= lightParameters.w;

you can add
Code:
outColorA.z *= 0.5;


this takes the blue component of the calculated color at that moment, whatever it may be and cuts half of it, this should make the result way more yellowish Smile

there are more tweaks you can do by adding some constant factors in some places like that 0.5 used for blue above;

and sure, there is always the "hard" way to recode the whole shader.


it is posible to add more lights too, as it is the mod handles only to

Code:
      outColor.xyz *= (spot(vertPos,light_R,lightDir,attenuationMap,lightParameters.x) +
         spot(vertPos,light_L,lightDir,attenuationMap,lightParameters.x));


as you can see, the "spot" attenuation is evaluated 2 times, the only difference being the light position, light_L and light_R;

to add red back lights some basic code must be added;

first the lightDir, should be mirrored, then the brake light positions which are already available at the top of the shader can be used:
Code:

      float3 brakeLightDirection = - lightDir;

      //set initial brake light as red
      float3 brakeLightContribution = float3(1,0.2,0.2);

      //calculate the amount of red
      brakeLightContribution.x = (spot(vertPos,brake_L,brakeLightDirection,attenuationMap,lightParameters.x) +
                           spot(vertPos,brake_R,brakeLightDirection,attenuationMap,lightParameters.x));

      //add the brake light to the final color
      outColorA.xyz += outColorA.xyz*brakeLightContribution;


so in PS_16.h you will end with something like:
Code:

      .................
   float distance =    length(vertPos - light_R);
   if(distance > lightParameters.x)
   {
      outColorA.xyz *= 0.2;
   }
   else
   {
      outColorA.xyz *=   (spot(vertPos,light_R,lightDir,attenuationMap,lightParameters.x) +
                     spot(vertPos,light_L,lightDir,attenuationMap,lightParameters.x));

      float3 brakeLightDirection = - lightDir;

      //set initial brake light as red
      float3 brakeLightContribution = float3(1,0.2,0.2);

      //calculate the amount of red
      brakeLightContribution.x = (spot(vertPos,brake_L,brakeLightDirection,attenuationMap,lightParameters.x) +
                           spot(vertPos,brake_R,brakeLightDirection,attenuationMap,lightParameters.x));

      //add the brake light to the final color
      outColorA.xyz += outColorA.xyz*brakeLightContribution;      
   }
   outColorA.xyz *= lightParameters.w;

   return  outColorA;
}


please note i didnt tested this last part because my rbr is set up for another project at this moment, quite a mess actually but anyway it should work, and if so, the only big problem will be the fact the brake lights are not spots but kinda omnidirectional so to say, not counting a even bigger FPS drop caused by 2 extra lights Smile which should not be a problem for your system.



i didnt changed the sky so the moon is the sun actually, but this may change with the project i'm curently working on, we'll see.

i know math sucks but the math used here is quite basic actually, nothing to be afraid of, also, to make some tweaks you dont really need to understand every bit of code, sure you may need to know what a "float" means and that "float4" means actually "4 floats"... Smile

enough i guess, have fun!
 

 Back to top

View user's profileSend private message
 Flagmo-T
 
 

  denmark.gif
 Joined: 28 Nov 2005
 Posts: 571
PostPosted: Sun Feb 18, 19:25 Reply to topicReply with quote
Thanks Black...

Nice feed back to my reply, I will get into it as soon as possible..
and of course show you results along the way.. Smile

Regards
Flag mo-T

ps. while I'm ad it. Can i Open a (rar) LBS-file ?, and How ?
the sky boxes are in a LBS file, I have tried with Winrar, But No!!..Question
_________________
Deep in my mind i believe everything is possible - https://www.flagmo-t.com/ Is my Richard Burns rally playground.
 

 Back to top

View user's profileSend private message
 Rallymec
 
 

  france.gif
 Joined: 13 Dec 2006
 Posts: 128
PostPosted: Tue Feb 27, 18:05 Reply to topicReply with quote
Super mod that's sure ! Very Happy Wink
But tell me, Confused
Is it possible the car don't shine ? Surprised
because (we're agree)we can the Subaru in the dark, the blue the yellow etc... Rolling Eyes

Sorry for my bad english, have you understand me Question Embarassed
_________________
FAN DE RALLYE, HOMME DE FOLIE !!!
 

 Back to top

View user's profileSend private message
 subaru555rally
 
 

  usa.gif
 Joined: 30 Sep 2007
 Posts: 2
PostPosted: Mon Mar 17, 08:53 Reply to topicReply with quote
This is an outstanding mod!! I never thought this would even be possible for use in RBR. I've been trying it out and I am very impressed. I was wondering if there is an easy way to make the shine on the car not as bright without editing the TrackSettings.ini file?

Car_Ambient_Lighting = 1.000000
Car_Deep_Shadow_Alpha = 1.000000
Car_Diffuse_Lighting = 1.000000
Car_Lighting = 1.000000

I found by lowering these numbers you can make the car darker but there may be an easier way instead of editing every track in the file? Also if someone knows how to take off the shadow from the sun on the ground from the car that can still be seen when using the night mod please let me know.
 

 Back to top

View user's profileSend private messageAIM Address
Page 3 of 3 Goto page Previous  1, 2, 3  
 Post new topicReply to topic
Powered by phpBB © 2001,2005 phpBB Group
Jump to :
ABOUT US | CONTACT | ADVERTISING | LINK US | RSS Blackhole Motorsports Copyright © 2005. Hosted by Isolcom Interactive Ltd.