How to export Rain and Weather info from ASI to shader in GTA 5?

Post Reply
  • Author
  • Message
Offline
Posts: 9
Joined: 27 Sep 2023, 23:45

How to export Rain and Weather info from ASI to shader in GTA 5?

So, i'm trying to create an ASI plugin that allows to export live game info to shaders for GTA 5. I know that ENB already has those, but as i said, i'm trying to learn it. I came up with this but it doesn't works.

float Rain = 0.0;

void RainData()
{
int RainValue = GAMEPLAY::GET_RAIN_LEVEL();

if (RainValue > 0.0)
{
Rain = 1.0;
}
else
{
Rain = 0.0;
}
}

void main()
{
while (true)
{
RainData();
WAIT(0);
}
}

void ScriptMain()
{
srand(GetTickCount());
main();
}

And i really don't know how to proceed from there .

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17447
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: How to export Rain and Weather info from ASI to shader in GTA 5?

If you mean in to the shaders of enbseries, then there is an enbsdk with example how to do that. If to the game shaders - i don't know.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
Posts: 9
Joined: 27 Sep 2023, 23:45

Re: How to export Rain and Weather info from ASI to shader in GTA 5?

ENBSeries wrote: 09 Mar 2024, 09:54 If you mean in to the shaders of enbseries, then there is an enbsdk with example how to do that. If to the game shaders - i don't know.
And how are external parameters such as Weather, TimeOfDay1 or TimeOfDay2 are exported from the dll to the .fx file?

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17447
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: How to export Rain and Weather info from ASI to shader in GTA 5?

As i said, use enbsdk. It have example project where you can use enbSetParameter function to set values to shaders.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7
Post Reply