Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Rand() in NoiseTexture.cpp #2757

Merged
merged 1 commit into from
Feb 19, 2023
Merged

Conversation

Rosalie241
Copy link
Contributor

@Rosalie241 Rosalie241 commented Feb 13, 2023

This patch is pulled from #2236 to improve the initializing noise texture speed, this patch makes it pretty much instant.

@m4xw
Copy link
Contributor

m4xw commented Feb 14, 2023

Should be obsolete if i ever get to #2236 for all intents and purposes but lets see

@Rosalie241 Rosalie241 changed the title Introduce a noise texture cache Improve Rand() in NoiseTexture.cpp Feb 14, 2023
@Rosalie241
Copy link
Contributor Author

After some discussion with m4xw on discord, I just pulled the code mentioned from the mentioned issue, which helps a lot, I also made both mudlord and m4xw commit author.

@m4xw
Copy link
Contributor

m4xw commented Feb 15, 2023

Fwiw i still plan to someday do a nice class like i wanted before but if this gets merged we may close my Issue for the time being.
Also just for the record, current logic was bugged as well as it created random data on the thread using MT but then only proceeds to use them as seeds and rely on cryptographically secure rng.
To me seems implied that with the old implementation you would've wanted to pass the generator itself and then use it inside FillTextureData, but either way, this impl is a lot faster, essentially instant.

@mudlord
Copy link
Contributor

mudlord commented Feb 16, 2023

Thanks for this @Rosalie241 I forgot I even did this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants