Page 1 of 1

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

Posted: 08 Mar 2024, 21:55
by Labont
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 .

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

Posted: 09 Mar 2024, 09:54
by ENBSeries
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.

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

Posted: 09 Mar 2024, 22:21
by Labont
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?

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

Posted: 10 Mar 2024, 09:34
by ENBSeries
As i said, use enbsdk. It have example project where you can use enbSetParameter function to set values to shaders.