Guest User

Untitled

a guest
May 20th, 2022
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 63.81 KB | None | 0 0
  1.  
  2. DEVELOPMENT FORUMS
  3. Revisiting engulfment mechanics
  4. posted by @Kasterisk день назад, четверг 19-го мая 2022 13:19:58 +03:00
  5. Few months have passed and the new engulfment mechanic is shaping up nicely. Here’s a summary of the overall progress and what ended up being implemented for future reference as of the current state of this revamp’s pull request at the time of writing.
  6.  
  7. The engulfment process for any valid engulfable objects starts upon immediate contact with the engulfer’s membrane, this completely removes the ability for preys to escape engulfment so they have t…
  8.  
  9. This post was truncated! click here to read the full post.
  10. Gameplay Discussion: Benefits of Being a Larger Cell
  11. posted by @hhyyrylainen henri_hyyrylainen 4 дня назад, понедельник 16-го мая 2022 20:00:08 +03:00
  12. github.com/Revolutionary-Games/Thrive
  13. Made nucleus give a 50% damage reduction Revolutionary-Games:master ← Revolutionary-Games:nucleus_damage_reduction_v2 opened 04:59PM - 16 May 22 UTC hhyyrylainen +9 -0 except to ATP d…
  14. This post was truncated! click here to read the full post.
  15. Implementing New Game Settings
  16. posted by @Oliveriver 7 дней назад, пятница 13-го мая 2022 22:15:25 +03:00
  17. I think I agree about cannibalism. My reason for including it here was a reaction to complaints from players in the current version (see here) but it’s probably not much more work to have it as a per-species mutation, which offers much more dynamic gameplay options.
  18.  
  19. Implementing New Game Settings
  20. posted by @Buckly 7 дней назад, пятница 13-го мая 2022 22:04:32 +03:00
  21. This is good, I support this overall layout for the most part.
  22.  
  23. The proposed difficulty settings are a great start, while some feel like they might take some additional effort to implement, others are pretty much already a thing since they are just constants in constant.cs, they’re just not customizable variables right now. It also doesn’t seem like it will take toomuch effort to balance since we’ll just need to focus primarily on the “normal” set…
  24.  
  25. This post was truncated! click here to read the full post.
  26. Implementing New Game Settings
  27. posted by @Deus 7 дней назад, пятница 13-го мая 2022 21:47:32 +03:00
  28. This all looks good, and good idea to centralize this discussion into a post.
  29.  
  30. One small comment though is that I feel since cannibalism should more be an adaptation rather than a setting per se, as it’s a unique behavior with evolutionary benefits and detriments. Although it can definitely a permanent mode/setting as well; perhaps the community would find it interesting.
  31.  
  32. Implementing New Game Settings
  33. posted by @hhyyrylainen henri_hyyrylainen 7 дней назад, пятница 13-го мая 2022 21:42:56 +03:00
  34. Yeah, I think the advanced view would be fine to split things into tabs to fit even more options in there.
  35.  
  36. Implementing New Game Settings
  37. posted by @Oliveriver 7 дней назад, пятница 13-го мая 2022 21:23:19 +03:00
  38. Hmm, good point. I still like the three tabs idea as it nicely separates the major variables, so maybe that could be the advanced view as you say.
  39.  
  40. Implementing New Game Settings
  41. posted by @hhyyrylainen henri_hyyrylainen 7 дней назад, пятница 13-го мая 2022 21:08:40 +03:00
  42. I think the potential options are fine, but I think the representation needs to be considered.
  43.  
  44. My idea is that basically there’s just a scrollable view with the most important settings like difficulty, planet type, random game seed, LAWK, and which type of start to have. Basically options that players can look through and change, even on their first playthrough. Then all of the other options would be behind some button to open advanced setting. T…
  45.  
  46. This post was truncated! click here to read the full post.
  47. Implementing New Game Settings
  48. posted by @Oliveriver 7 дней назад, пятница 13-го мая 2022 20:57:34 +03:00
  49. The purpose of this thread is to design the new game settings screen (excluding planet generation), ideally ready for implementation in 0.5.9.
  50.  
  51. I’m jumping the gun a bit here as I won’t be able to work on this for like a month (exams + learning the codebase + smaller additions first) but considering some recent discussions and features currently being worked on, I think it makes sense to get this discussion started. I’ve been thinking about it qui…
  52.  
  53. This post was truncated! click here to read the full post.
  54. Reproduction vs Mutations
  55. posted by @Deus 8 дней назад, четверг 12-го мая 2022 21:37:59 +03:00
  56. Commenting here in accordance to my thoughts in the exploration thread regarding lateral gene transfer and in light of recent discussion for a mechanism for discounts: Exploration
  57.  
  58. I think for the purposes of the Microbe stage, it’s good enough to represent lateral genetic transfer through the mechanism of transformation. I’m using Nick Lane’s “The Vital Question” as a source of information here, where he says that especially for prokaryotes, late…
  59.  
  60. This post was truncated! click here to read the full post.
  61. Organelle Upgrades
  62. posted by @Deus 8 дней назад, четверг 12-го мая 2022 19:49:39 +03:00
  63. You’re right in regard to the iron-as-byproduct comment. It is indeed a waste product of lithotrophic metabolic processes. And also, I do advocate for having something like a hydrogenosome be a variant.
  64.  
  65. And I understand where a lot of this feeling of “mess” can come from. Atleast for me, it comes with realizing there are multiple concepts, like the protein enzymes concept and organelle modifications, that can deal with similar facets of the game,…
  66.  
  67. This post was truncated! click here to read the full post.
  68. Organelle Upgrades
  69. posted by @Buckly 8 дней назад, четверг 12-го мая 2022 06:59:55 +03:00
  70. I think these are some good ideas to start with.
  71.  
  72. When we are ready to attempt implementation, I think that focusing on the fundamental/popular parts like mitochondria and chloroplasts (and their prokaryote analogue) first will be wise. Balancing and fine-tuning this feature is gonna be pretty intensive.
  73.  
  74. Deus:
  75. Mineralization - Creates mineralized granules which add +2 Health, but reduces ATP production by 10%. (source) https://journals.asm.org/…
  76. This post was truncated! click here to read the full post.
  77. Organelle Upgrades
  78. posted by @hhyyrylainen henri_hyyrylainen 9 дней назад, среда 11-го мая 2022 20:01:52 +03:00
  79. Deus:
  80. but right-clicking on the part button in the editor GUI applies modifications to all future instances of that part placed.
  81.  
  82. That sounds like even more work as that would be a separate system and it needs to be designed how that interacts with normal upgrades. I’d highly suggest we do not consider that kind of desig…
  83.  
  84. This post was truncated! click here to read the full post.
  85. Organelle Upgrades
  86. posted by @Deus 9 дней назад, среда 11-го мая 2022 06:42:35 +03:00
  87. We are approaching a point in development where upgrades might be more relevant, so here are some proposed organelle upgrades to ensure that we have material. Much of it is based on Buckly’s previous post above, and I simply included more organelles and slightly tweaked some existing concepts, which absolutely is open to comment and reversion.
  88.  
  89. I would like to spend some time in the near future on related concepts, such as refining the enzyme conc…
  90.  
  91. This post was truncated! click here to read the full post.
  92. Gameplay Discussion: Benefits of Being a Larger Cell
  93. posted by @Maxonovien 13 дней назад, суббота 7-го мая 2022 12:24:37 +03:00
  94. But there aren’t much concussive damage at the time being, are they? Pili are mure more sharp damages, for which bigger size does not help much afaik.
  95.  
  96. Also, as a note, it won’t be of any use to have bigger cells evolve in the auto-evo, because health isn’t even remotely considered.
  97.  
  98. Gameplay Discussion: Benefits of Being a Larger Cell
  99. posted by @hhyyrylainen henri_hyyrylainen 13 дней назад, суббота 7-го мая 2022 10:26:19 +03:00
  100. I’ll say this again: you should use the engulf size as that’s automatically adjusted for bacteria’s 50% smaller scale.
  101.  
  102. Gameplay Discussion: Benefits of Being a Larger Cell
  103. posted by @Thim 14 дней назад, суббота 7-го мая 2022 03:52:57 +03:00
  104. done: GitHub - Revolutionary-Games/Thrive at health_from_size
  105.  
  106. Gameplay Discussion: Benefits of Being a Larger Cell
  107. posted by @Buckly 14 дней назад, суббота 7-го мая 2022 03:37:20 +03:00
  108. I say it’s worth trying out. It’s probably not too hard to shove hexcount into the max health calculation of a species for a simple prototype.
  109.  
  110. Gameplay Discussion: Benefits of Being a Larger Cell
  111. posted by @Deus 14 дней назад, пятница 6-го мая 2022 20:55:21 +03:00
  112. Input from our theorist, @Bird:
  113.  
  114. She thinks of health and the HP stat as indicative of an organism’s capability to resist physical (concussive) and environmental damage. Along those lines, she does think that larger size should equal to more health, also bringing up that prokaryotes don’t really physically attack eukaryotes. What prokaryotes do instead against eukaryotes is resort to the excreting of toxins and enzymes, which remains potent agains…
  115.  
  116. This post was truncated! click here to read the full post.
  117. Gameplay Discussion: Benefits of Being a Larger Cell
  118. posted by @hhyyrylainen henri_hyyrylainen 14 дней назад, пятница 6-го мая 2022 12:40:53 +03:00
  119. Deus:
  120. halved damage from a nucleus seems a tad arbitrary, but increased health from mass makes sense.
  121.  
  122. Again, evolving the nucleus gives the cell 50% more size immediately…
  123.  
  124. I’d wish we had active theorists to talk about the realism of more health from larger size…
  125.  
  126. Gameplay Discussion: Benefits of Being a Larger Cell
  127. posted by @Deus 14 дней назад, пятница 6-го мая 2022 06:53:52 +03:00
  128. Pasted from GitHub comment for better organization…
  129.  
  130. Tested this in free build since it was taking a pretty long time for predatory adaptations to evolve in the AI, so it might be an imperfect representation of gameplay experience.
  131.  
  132. It definitely had an effect with prokaryotes that have a posterior pilus, which is a pretty common build to evolve in traditional gameplay. It doesn’t feel like you get your health absolutely drained. It’s still a bit ex…
  133.  
  134. This post was truncated! click here to read the full post.
  135. Gameplay Discussion: Benefits of Being a Larger Cell
  136. posted by @hhyyrylainen henri_hyyrylainen 15 дней назад, четверг 5-го мая 2022 14:23:57 +03:00
  137. One caveat is that at least how I understood the feature is that it reduces the damage from prokaryotes not everything. So for example out of ATP damage should stay the same. Reducing damage from environmental toxins and chunks is fine by me as tracking the ultimate damage source otherwise would be quite a bit more difficult to implement.
  138.  
  139. Gameplay Discussion: Benefits of Being a Larger Cell
  140. posted by @Thim 15 дней назад, четверг 5-го мая 2022 13:55:39 +03:00
  141. 30 minutes early, but I think it’s safe to say that 50% damage reduction wins. Honestly, this result baffles me, but it was easy to implement: Make Nucleus Reduce Incoming Damage by Half by adQuid · Pull Request #3317 · Revolutionary-Games/Thrive · GitHub
  142.  
  143. Gameplay Discussion: Benefits of Being a Larger Cell
  144. posted by @Thim 19 дней назад, воскресенье 1-го мая 2022 23:36:30 +03:00
  145. Yes I can, but not more than five minutes after opening the last poll. Here’s a new one:
  146.  
  147. Click to view the poll.
  148.  
  149. Gameplay Discussion: Benefits of Being a Larger Cell
  150. posted by @hhyyrylainen henri_hyyrylainen 19 дней назад, воскресенье 1-го мая 2022 23:12:48 +03:00
  151. Thim:
  152. I’ll close this poll on Thursday to compensate.
  153.  
  154. You could set the exact closing time on the poll so it closes automatically and shows people how long it will last.
  155.  
  156. Gameplay Discussion: Benefits of Being a Larger Cell
  157. posted by @Thim 19 дней назад, воскресенье 1-го мая 2022 23:00:09 +03:00
  158. Ok, I forgot to open the poll yesterday. Since it’s a day late, I’ll close this poll on Thursday to compensate.
  159.  
  160. Click to view the poll.
  161.  
  162. Exploration
  163. posted by @Magart Marco Garbelli 19 дней назад, воскресенье 1-го мая 2022 20:30:19 +03:00
  164. Speaking about environment “embellishment”, I’m no expert but I think that it would make sense that you could have minerals and low-solubility salts forming very small crystals. Modelling wise the particles shouldn’t even be very complicated to generate as they usually follow a very regular and geometrical structure (but I’ve just dipped my feet in 3d modelling so don’t take me for granted). Apart from that I would imagine you could have differe…
  165.  
  166. This post was truncated! click here to read the full post.
  167. Disposed Microbe Problem
  168. posted by @84634E1A607A Ajax Dong 19 дней назад, воскресенье 1-го мая 2022 11:56:46 +03:00
  169. Kasterisk:
  170. Also for toggling physics debugging in runtime, it might be possible: SceneTree.debug_collisions_hint .
  171.  
  172. This only applies to those newly spawned. The entities already on the scene won’t be affected.
  173.  
  174. Exploration
  175. posted by @Kasterisk 19 дней назад, воскресенье 1-го мая 2022 09:27:13 +03:00
  176. Hiding unexplored patches/regions has already been planned from past concepts so it should be added. In this concept art for example, how it’s done visually is fading out the connecting lines to the hidden patches.
  177.  
  178.  
  179.  
  180. Exploration
  181. posted by @hhyyrylainen henri_hyyrylainen 20 дней назад, суббота 30-го апр. 2022 23:37:02 +03:00
  182. I think it would be a pretty good idea to hide the patches that aren’t next to ones the player is currently in / has been in from the map to require the player to explore it to find all the patches.
  183.  
  184. Exploration
  185. posted by @Kemikal Alex 20 дней назад, суббота 30-го апр. 2022 22:49:59 +03:00
  186. Deus:
  187. As a post note in regard to exploring the procedural map: I think it’s fine if we just implement a fog of war, where you can only see a certain amount of patches beyond your current one. This adds a bit more weight to the decision to move – I sure hope there’s a better patch here if I move there, or I wonder if the ocean surface starts after this patch or the next, or I didn’t know there was a cave/abyss here; things like that. We shou…
  188. This post was truncated! click here to read the full post.
  189. Disposed Microbe Problem
  190. posted by @hhyyrylainen henri_hyyrylainen 20 дней назад, суббота 30-го апр. 2022 13:24:27 +03:00
  191. That’s interesting. Probably caused by the physics system not triggering the callbacks symmetrically?
  192. I think it’ll be fine to check if a microbe is dead before starting to engulf it, that kind of check makes sense to me.
  193.  
  194. Disposed Microbe Problem
  195. posted by @84634E1A607A Ajax Dong 20 дней назад, суббота 30-го апр. 2022 13:10:33 +03:00
  196. Disposed microbes are all dead.
  197.  
  198. Somehow I’ve found that touchedMicrobes is not symmetric (I mean that A has B, but sometimes B doesn’t have A). My temprory fix is to check for dead microbes every time CanEngulf is called. But this is apparently not a good one.
  199.  
  200. Release planning for 0.5.9 (and 0.5.8.1)
  201. posted by @hhyyrylainen henri_hyyrylainen 20 дней назад, суббота 30-го апр. 2022 11:48:52 +03:00
  202. 0.5.8.1 is out now:
  203.  
  204. GitHub
  205.  
  206. Release Thrive 0.5.8.1 · Revolutionary-Games/Thrive
  207. This release focuses on performance improvements and other smaller fixes. R…
  208.  
  209. This post was truncated! click here to read the full post.
  210. Exploration
  211. posted by @Deus 20 дней назад, суббота 30-го апр. 2022 07:08:07 +03:00
  212. Buckly brought up exploration in discussion and I haven’t seen a dedicated thread for it. So I wanted to centralize some thoughts regarding it instead of having a lot of scattered ideas across various threads and discord.
  213.  
  214. It was mentioned that right now, the only reason why a player would want to explore is to find more compound clouds. I think that’s a good base layer for incentivizing exploration as it is mission-centric to the gameplay loop as…
  215.  
  216. This post was truncated! click here to read the full post.
  217. Gameplay Discussion: Benefits of Being a Larger Cell
  218. posted by @Thim 21 день назад, пятница 29-го апр. 2022 14:02:49 +03:00
  219. I’ll add the proposal for the nucleus providing damage reduction. If anyone wants to advocate for it type something out and I’ll add it to the description, but otherwise I’ll do my best.
  220.  
  221. I guess that leads to a deeper question though: is the concern here giving advantage to larger microbes as a whole, or giving advantage to the nucleus?
  222.  
  223. Ventus - New Sound desiner
  224. posted by @Oliveriver 23 дня назад, среда 27-го апр. 2022 23:40:28 +03:00
  225. Ah, I had no idea that existed. Thanks for pointing that out, I’ll keep it in mind in future.
  226.  
  227. Gameplay Discussion: Benefits of Being a Larger Cell
  228. posted by @hhyyrylainen henri_hyyrylainen 23 дня назад, среда 27-го апр. 2022 20:59:05 +03:00
  229. Deus:
  230. I remember another idea hhyyrylainen brought up was to have the nucleus halve damage received. I’m a bit wary of this since I’m not sure that b…
  231.  
  232. This post was truncated! click here to read the full post.
  233. Gameplay Discussion: Benefits of Being a Larger Cell
  234. posted by @Deus 23 дня назад, среда 27-го апр. 2022 20:54:20 +03:00
  235. We had a bit of discussion earlier on discord regarding limited benefits to size in game. Regarding the idea of health being attached to size/mass, some concerns were brought up that prokaryotes would be heavily nerfed in their capabilities with combat against eukaryotes. I personally think that this is fine since strategies like predation really started emerging with eukaryotes and similar sized cells due to the newfound evolutionary viability …
  236.  
  237. This post was truncated! click here to read the full post.
  238. Ventus - New Sound desiner
  239. posted by @Kasterisk 23 дня назад, среда 27-го апр. 2022 19:30:45 +03:00
  240. We do have this list of sound effects in the wiki which I have recently updated to match the current sfx situation ingame. Now that I think about it, the list should also include the actual corresponding sound so that people can listen to it directly in the wiki, I’ll probably add it soon.
  241.  
  242. Also welcome to the team Ventus!
  243.  
  244. Offline Thread
  245. posted by @Oliveriver 23 дня назад, среда 27-го апр. 2022 18:57:17 +03:00
  246. Reviving this thread because why not?
  247.  
  248. I’m going to be very busy until the end of May. I would like to stay away from Thrive as much as possible in that time to stop myself getting distracted. I’ll check in on things but doubt I’ll be involved in any discussions.
  249.  
  250. After that though, I’ll be free and ready to get to some programming work.
  251.  
  252. NEWS
  253. Progress Update 5/14/2022
  254. posted by Revolutionary Games 6 дней назад, суббота 14-го мая 2022 16:50:14 +03:00
  255. Categories: Outreach, Graphics, Progress Report
  256.  
  257. We had a decent amount of progress this week with many of our WIP features like the patch map generation and engulfment, which we are very excited to see completed. We’ve also had an exciting amount of assets created this week, which are shown off below. These additions are looking to make for an exciting update in the future of Thrive!
  258.  
  259. We regret to say that saves are going to be incompatible between 0.5.8 and 0.5.9 and will not carry over. The f…
  260.  
  261. This post was truncated! click here to read the full post.
  262. Progress Update 05/07/2022
  263. posted by Revolutionary Games 13 дней назад, суббота 7-го мая 2022 17:24:36 +03:00
  264. Categories: Outreach, Progress Report
  265.  
  266. This week we focused out efforts on fixing alot of the issues found in the latest release, as well as continued progress on the patch-map systems, and testing out various ways to grant benefits to cell size.
  267.  
  268. we have re-released 0.5.8.1 as there was a problem where the crash reporter didn’t correctly generate crash callstacks, making the reports almost completely useless. To rectify this a tweak was made to our Godot build scripts and new builds o…
  269.  
  270. This post was truncated! click here to read the full post.
  271. Progress Update 04/30/2022 | Patch 0.5.8.1
  272. posted by Revolutionary Games 20 дней назад, суббота 30-го апр. 2022 17:04:42 +03:00
  273. Categories: Outreach, Releases, Progress Report
  274.  
  275. Update 0.5.8.1 is now out, and introduces a good amount of performance improvements, among other things. We hope that this significantly improves the enjoyability of Thrive, and look forward to hearing any feedback on the changes.
  276.  
  277. This week we focused on performance, and the causes behind it. We eventually discovered that the spawn system was spawning entities far faster than they could be despawned which resulted in a massive hit to performance …
  278.  
  279. This post was truncated! click here to read the full post.
  280. Progress Update 04/23/2022
  281. posted by Revolutionary Games месяц назад, суббота 23-го апр. 2022 16:27:18 +03:00
  282. Categories: Outreach, Progress Report
  283.  
  284. Ever since the release of 0.5.8 last week, we have been having a blast seeing all the cool creations players have made in the multicellular prototype. We’ve been getting a large amount of feedback as well, which has helped tremendously in identifying some difficulties with game performance that we have since pursued. Next week, we hope to create a patch to address some of the performance issues that players have reported, and maybe some other ch…
  285.  
  286. This post was truncated! click here to read the full post.
  287. Devblog #32: Making History
  288. posted by Revolutionary Games месяц назад, суббота 16-го апр. 2022 18:16:54 +03:00
  289. Categories: Announcements, Releases, Microbe Stage, Multicellular Stage, Outreach, Progress Report
  290. Thrive version 0.5.8 is finally here; And with it comes the versatile signaling agents, which allow you to actively communicate with your allied cells; New randomly generated region names, which gives each world a new and unique flair; The highly anticipated multicellular prototype, which permits you to progress further than ever in the grand journey of Thrive; And of course, a grand host of other changes and bug-fixes!
  291.  
  292. You can download the launc…
  293.  
  294. This post was truncated! click here to read the full post.
  295. Progress Update 04/09/2022
  296. posted by Revolutionary Games месяц назад, суббота 9-го апр. 2022 17:27:10 +03:00
  297. Categories: Outreach, Progress Report
  298.  
  299. This week our team exploded in activity as new and old developers alike were invigorated by recent developments, which resulted in a great amount of progress made. The fruits of our labor will officially release on the 16th, but you may also experience these newest changes now by downloading our newly available release candidate build.
  300.  
  301. Programming
  302. New DevBuild for our patrons:Various fixes to the early multicellular prototype, cell layouts now sho…
  303. This post was truncated! click here to read the full post.
  304. Progress Update 04/02/2022
  305. posted by Revolutionary Games 2 месяца назад, суббота 2-го апр. 2022 23:42:48 +03:00
  306. Categories: Outreach, Progress Report
  307.  
  308. This week we’ve finally produced a playable build for the multicellular prototype which currently features cell type specialization and gameplay. This is a monumental step in Thrive’s development, but there are yet many more steps on the long road of progress that await us. This prototype will be packaged with the 0.5.8 update, which also includes the new signaling agents part and a large host of other changes.
  309.  
  310. 0.5.8 is currently scheduled to rel…
  311.  
  312. This post was truncated! click here to read the full post.
  313. Progress Update 3/26/2022
  314. posted by Revolutionary Games 2 месяца назад, суббота 26-го мар. 2022 16:08:56 +02:00
  315. Categories: Outreach, Progress Report
  316.  
  317. This past week we’ve witnessed some increased interest in our project coinciding with the release of Oliver’s video, along with the addition of two new programmers to our team. We’d like to welcome everyone to our community, and hope to continue to impress and inspire with our steadily growing game.
  318.  
  319. Progress on our multicellular prototype has reached a point where we can now reveal visible results! It may not look pretty now, but every gem begins…
  320.  
  321. This post was truncated! click here to read the full post.
  322. Progress Update 3/19/2022
  323. posted by Revolutionary Games 2 месяца назад, воскресенье 20-го мар. 2022 03:18:23 +02:00
  324. Categories: Outreach, Progress Report
  325.  
  326. It’s another week as we continue to march forward in progress, something that might pick up in speed now that some of our programmers are able to find time for Thrive’s development again.
  327.  
  328. Development continues to be focused on our multicellular prototype, with emphasis on the cell previews in the editor. We’ve also given our tutorials a new coat of paint in hopes of making them more informative and comprehensible.
  329.  
  330. Programming
  331. New DevBuild for our …
  332. This post was truncated! click here to read the full post.
  333. Progress Update 3/12/2022
  334. posted by Revolutionary Games 2 месяца назад, суббота 12-го мар. 2022 17:48:54 +02:00
  335. Categories: Outreach, Progress Report
  336.  
  337. Our lead programmer continues to focus their efforts on the multicell prototype, while everyone else has been working on changes that have not yet been committed to the game proper. As a result we unfortunately do not have anything of substance to show off this week.
  338.  
  339. Refactoring the microbe editor turned out to be quite the feat, but we are happy to say that it is now complete and ready to go. This is a vital step in the creation of the next stag…
  340.  
  341. This post was truncated! click here to read the full post.
  342.  
  343. Playing Thrive 0.5.8.1
  344. Thrive is running. Log output:
  345. Process Started
  346. Godot Engine v3.4.4.stable.mono..3089e490a - https://godotengine.org
  347. OpenGL ES 3.0 Renderer: ATI Mobility Radeon HD 4200 Series
  348. OpenGL ES Batching: ON
  349. Mono: Log file is: 'C:/Users/Profile1/AppData/Roaming/Thrive/mono/mono_logs/2022-05-20_19.07.17_448.log'
  350. This is Thrive version: 0.5.8.1
  351. Startup C# locale is: ru-RU Godot locale is: ru_RU
  352. user:// directory is: C:/Users/Profile1/AppData/Roaming/Thrive
  353. Game logs are written to: C:/Users/Profile1/AppData/Roaming/Thrive\logs latest log is 'log.txt'
  354. Doing delayed apply for some settings
  355. Set audio output device to: Default
  356. Set C# locale to: en Godot locale is: en
  357. No SteamClient class found, not initializing Steam
  358. Loaded registry for Compound with 11 items
  359. Loaded registry for MembraneType with 6 items
  360. Loaded registry for Background with 11 items
  361. Loaded registry for Biome with 11 items
  362. Loaded registry for BioProcess with 13 items
  363. Loaded registry for OrganelleDefinition with 23 items
  364. Loaded registry for MusicCategory with 6 items
  365. Loaded registry for HelpTexts with 5 items
  366. Loaded registry for NamedInputGroup with 6 items
  367. Loaded registry for Gallery with 3 items
  368. SimulationParameters loading ended
  369. SimulationParameters are good
  370. Loading mod Nodes into the scene tree
  371. Jukebox now playing from: Menu
  372. Jukebox: starting track: res://assets/sounds/main-menu-theme-1.ogg position: 0
  373. TaskExecutor started with parallel job count: 2
  374. Previous patch doesn't exist, despawning all entities.
  375. Applying patch (Karronon Volcanic Vent) settings
  376. Number of clouds in this patch = 8
  377. Registering new spawner: Name: ammonia density: 4E-05
  378. Registering new spawner: Name: glucose density: 2E-05
  379. Registering new spawner: Name: phosphates density: 4E-05
  380. Registering new spawner: Name: hydrogensulfide density: 4E-05
  381. oxygen spawn density is 0. It won't spawn
  382. carbondioxide spawn density is 0. It won't spawn
  383. nitrogen spawn density is 0. It won't spawn
  384. sunlight spawn density is 0. It won't spawn
  385. Number of chunks in this patch = 4
  386. Registering new spawner: Name: FLOATING_HAZARD density: 0.0001
  387. Registering new spawner: Name: SMALL_IRON_CHUNK density: 3E-05
  388. MARINE_SNOW spawn density is 0. It won't spawn
  389. Registering new spawner: Name: BIG_IRON_CHUNK density: 8E-05
  390. Number of species in this patch = 1
  391. Registering new spawner: Name: 1 density: 1.438849E-05
  392. Player Microbe spawned
  393. Jukebox now playing from: MicrobeStage
  394. 1 | #version 330
  395. 2 | #define GLES_OVER_GL
  396. 3 | #define MAX_LIGHT_DATA_STRUCTS 409
  397. 4 |
  398. 5 | #define MAX_FORWARD_LIGHTS 32
  399. 6 |
  400. 7 | #define MAX_REFLECTION_DATA_STRUCTS 455
  401. 8 |
  402. 9 | #define MAX_SKELETON_BONES 1365
  403. 10 |
  404. 11 | #define ENABLE_OCTAHEDRAL_COMPRESSION
  405. 12 | #define USE_LIGHT_DIRECTIONAL
  406. 13 | #define USE_FORWARD_LIGHTING
  407. 14 | #define USE_RADIANCE_MAP
  408. 15 | #define USE_RADIANCE_MAP_ARRAY
  409. 16 | #define SHADOW_MODE_PCF_5
  410. 17 | #define USE_SHADOW
  411. 18 | #define USE_LIGHTMAP_FILTER_BICUBIC
  412. 19 | #define LIGHT_DIRECTIONAL_SHADOW
  413. 20 | #define LIGHT_USE_PSSM4
  414. 21 | #define USE_MATERIAL
  415. 22 | #define ENABLE_UV_INTERP
  416. 23 | precision highp float;
  417. 24 | precision highp int;
  418. 25 |
  419. 26 |
  420. 27 | /* texture unit usage, N is max_texture_unity-N
  421. 28 |
  422. 29 | 1-skeleton
  423. 30 | 2-radiance
  424. 31 | 3-reflection_atlas
  425. 32 | 4-directional_shadow
  426. 33 | 5-shadow_atlas
  427. 34 | 6-decal_atlas
  428. 35 | 7-screen
  429. 36 | 8-depth
  430. 37 | 9-probe1
  431. 38 | 10-probe2
  432. 39 |
  433. 40 | */
  434. 41 |
  435. 42 | uniform highp mat4 world_transform;
  436. 43 | /* clang-format on */
  437. 44 |
  438. 45 | #define M_PI 3.14159265359
  439. 46 | #define SHADER_IS_SRGB false
  440. 47 |
  441. 48 | /* Varyings */
  442. 49 |
  443. 50 | #if defined(ENABLE_COLOR_INTERP)
  444. Output is too long, it was truncated! See the log file for full output.
  445.  
  446. 898 | }
  447. 899 | #endif
  448. 900 | }
  449. 901 |
  450. 902 | #ifdef USE_LIGHTMAP
  451. 903 | #ifdef USE_LIGHTMAP_LAYERED
  452. 904 | uniform mediump sampler2DArray lightmap; //texunit:-9
  453. 905 | uniform int lightmap_layer;
  454. 906 | #else
  455. 907 | uniform mediump sampler2D lightmap; //texunit:-9
  456. 908 | #endif
  457. 909 |
  458. 910 | uniform mediump float lightmap_energy;
  459. 911 |
  460. 912 | #ifdef USE_LIGHTMAP_FILTER_BICUBIC
  461. 913 | uniform vec2 lightmap_texture_size;
  462. 914 |
  463. 915 | // w0, w1, w2, and w3 are the four cubic B-spline basis functions
  464. 916 | float w0(float a) {
  465. 917 | return (1.0 / 6.0) * (a * (a * (-a + 3.0) - 3.0) + 1.0);
  466. 918 | }
  467. 919 |
  468. 920 | float w1(float a) {
  469. 921 | return (1.0 / 6.0) * (a * a * (3.0 * a - 6.0) + 4.0);
  470. 922 | }
  471. 923 |
  472. 924 | float w2(float a) {
  473. 925 | return (1.0 / 6.0) * (a * (a * (-3.0 * a + 3.0) + 3.0) + 1.0);
  474. 926 | }
  475. 927 |
  476. 928 | float w3(float a) {
  477. 929 | return (1.0 / 6.0) * (a * a * a);
  478. 930 | }
  479. 931 |
  480. 932 | // g0 and g1 are the two amplitude functions
  481. 933 | float g0(float a) {
  482. 934 | return w0(a) + w1(a);
  483. 935 | }
  484. 936 |
  485. 937 | float g1(float a) {
  486. 938 | return w2(a) + w3(a);
  487. 939 | }
  488. 940 |
  489. 941 | // h0 and h1 are the two offset functions
  490. 942 | float h0(float a) {
  491. 943 | return -1.0 + w1(a) / (w0(a) + w1(a));
  492. 944 | }
  493. 945 |
  494. 946 | float h1(float a) {
  495. 947 | return 1.0 + w3(a) / (w2(a) + w3(a));
  496. 948 | }
  497. 949 |
  498. 950 | vec4 texture_bicubic(sampler2D tex, vec2 uv) {
  499. 951 | vec2 texel_size = vec2(1.0) / lightmap_texture_size;
  500. 952 |
  501. 953 | uv = uv * lightmap_texture_size + vec2(0.5);
  502. 954 |
  503. 955 | vec2 iuv = floor(uv);
  504. 956 | vec2 fuv = fract(uv);
  505. 957 |
  506. 958 | float g0x = g0(fuv.x);
  507. 959 | float g1x = g1(fuv.x);
  508. 960 | float h0x = h0(fuv.x);
  509. 961 | float h1x = h1(fuv.x);
  510. 962 | float h0y = h0(fuv.y);
  511. 963 | float h1y = h1(fuv.y);
  512. 964 |
  513. 965 | vec2 p0 = (vec2(iuv.x + h0x, iuv.y + h0y) - vec2(0.5)) * texel_size;
  514. 966 | vec2 p1 = (vec2(iuv.x + h1x, iuv.y + h0y) - vec2(0.5)) * texel_size;
  515. 967 | vec2 p2 = (vec2(iuv.x + h0x, iuv.y + h1y) - vec2(0.5)) * texel_size;
  516. 968 | vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - vec2(0.5)) * texel_size;
  517. 969 |
  518. 970 | return (g0(fuv.y) * (g0x * texture(tex, p0) + g1x * texture(tex, p1))) +
  519. 971 | (g1(fuv.y) * (g0x * texture(tex, p2) + g1x * texture(tex, p3)));
  520. 972 | }
  521. 973 |
  522. 974 | vec4 textureArray_bicubic(sampler2DArray tex, vec3 uv) {
  523. 975 | vec2 texel_size = vec2(1.0) / lightmap_texture_size;
  524. 976 |
  525. 977 | uv.xy = uv.xy * lightmap_texture_size + vec2(0.5);
  526. 978 |
  527. 979 | vec2 iuv = floor(uv.xy);
  528. 980 | vec2 fuv = fract(uv.xy);
  529. 981 |
  530. 982 | float g0x = g0(fuv.x);
  531. 983 | float g1x = g1(fuv.x);
  532. 984 | float h0x = h0(fuv.x);
  533. 985 | float h1x = h1(fuv.x);
  534. 986 | float h0y = h0(fuv.y);
  535. 987 | float h1y = h1(fuv.y);
  536. 988 |
  537. 989 | vec2 p0 = (vec2(iuv.x + h0x, iuv.y + h0y) - vec2(0.5)) * texel_size;
  538. 990 | vec2 p1 = (vec2(iuv.x + h1x, iuv.y + h0y) - vec2(0.5)) * texel_size;
  539. 991 | vec2 p2 = (vec2(iuv.x + h0x, iuv.y + h1y) - vec2(0.5)) * texel_size;
  540. 992 | vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - vec2(0.5)) * texel_size;
  541. 993 |
  542. 994 | return (g0(fuv.y) * (g0x * texture(tex, vec3(p0, uv.z)) + g1x * texture(tex, vec3(p1, uv.z
  543. )))) +
  544. 995 | (g1(fuv.y) * (g0x * texture(tex, vec3(p2, uv.z)) + g1x * texture(tex, vec3(p3, uv.z))));
  545. 996 | }
  546. 997 |
  547. 998 | #define LIGHTMAP_TEXTURE_SAMPLE(m_tex, m_uv) texture_bicubic(m_tex, m_uv)
  548. 999 | #define LIGHTMAP_TEXTURE_LAYERED_SAMPLE(m_tex, m_uv) textureArray_bicubic(m_tex, m_uv)
  549. 1000 |
  550. 1001 | #else //!USE_LIGHTMAP_FILTER_BICUBIC
  551. 1002 | #define LIGHTMAP_TEXTURE_SAMPLE(m_tex, m_uv) texture(m_tex, m_uv)
  552. 1003 | #define LIGHTMAP_TEXTURE_LAYERED_SAMPLE(m_tex, m_uv) texture(m_tex, m_uv)
  553. 1004 |
  554. 1005 | #endif //USE_LIGHTMAP_FILTER_BICUBIC
  555. 1006 | #endif
  556. 1007 |
  557. 1008 | #ifdef USE_LIGHTMAP_CAPTURE
  558. 1009 | uniform mediump vec4[12] lightmap_captures;
  559. 1010 | #endif
  560. 1011 |
  561. 1012 | #ifdef USE_GI_PROBES
  562. 1013 |
  563. 1014 | uniform mediump sampler3D gi_probe1; //texunit:-9
  564. 1015 | uniform highp mat4 gi_probe_xform1;
  565. 1016 | uniform highp vec3 gi_probe_bounds1;
  566. 1017 | uniform highp vec3 gi_probe_cell_size1;
  567. 1018 | uniform highp float gi_probe_multiplier1;
  568. 1019 | uniform highp float gi_probe_bias1;
  569. 1020 | uniform highp float gi_probe_normal_bias1;
  570. 1021 | uniform bool gi_probe_blend_ambient1;
  571. 1022 |
  572. 1023 | uniform mediump sampler3D gi_probe2; //texunit:-10
  573. 1024 | uniform highp mat4 gi_probe_xform2;
  574. 1025 | uniform highp vec3 gi_probe_bounds2;
  575. 1026 | uniform highp vec3 gi_probe_cell_size2;
  576. 1027 | uniform highp float gi_probe_multiplier2;
  577. 1028 | uniform highp float gi_probe_bias2;
  578. 1029 | uniform highp float gi_probe_normal_bias2;
  579. 1030 | uniform bool gi_probe2_enabled;
  580. 1031 | uniform bool gi_probe_blend_ambient2;
  581. 1032 |
  582. 1033 | vec3 voxel_cone_trace(mediump sampler3D probe, vec3 cell_size, vec3 pos, vec3 ambient, bool blend_ambient, vec3 direction, float tan_half_angle, float max_distance, float p_bias) {
  583. 1034 | float dist = p_bias; //1.0; //dot(direction,mix(vec3(-1.0),vec3(1.0),greaterThan(direction,vec3(0.0))))*2.0;
  584. 1035 | float alpha = 0.0;
  585. 1036 | vec3 color = vec3(0.0);
  586. 1037 |
  587. 1038 | while (dist < max_distance && alpha < 0.95) {
  588. 1039 | float diameter = max(1.0, 2.0 * tan_half_angle * dist);
  589. 1040 | vec4 scolor = textureLod(probe, (pos + dist * direction) * cell_size, log2(diameter));
  590. 1041 | float a = (1.0 - alpha);
  591. 1042 | color += scolor.rgb * a;
  592. 1043 | alpha += a * scolor.a;
  593. 1044 | dist += diameter * 0.5;
  594. 1045 | }
  595. 1046 |
  596. 1047 | if (blend_ambient) {
  597. 1048 | color.rgb = mix(ambient, color.rgb, min(1.0, alpha / 0.95));
  598. 1049 | }
  599. 1050 |
  600. 1051 | return color;
  601. 1052 | }
  602. 1053 |
  603. 1054 | void gi_probe_compute(mediump sampler3D probe, mat4 probe_xform, vec3 bounds, vec3 cell_size, vec3 pos, vec3 ambient, vec3 environment, bool blend_ambient, float multiplier, mat3 normal_mtx, vec3 ref_vec, float roughness, float p_bias, float p_normal_bias, inout vec4 out_spec, inout vec4 out_diff) {
  604. 1055 | vec3 probe_pos = (probe_xform * vec4(pos, 1.0)).xyz;
  605. 1056 | vec3 ref_pos = (probe_xform * vec4(pos + ref_vec, 1.0)).xyz;
  606. 1057 | ref_vec = normalize(ref_pos - probe_pos);
  607. 1058 |
  608. 1059 | probe_pos += (probe_xform * vec4(normal_mtx[2], 0.0)).xyz * p_normal_bias;
  609. 1060 |
  610. 1061 | /* out_diff.rgb = voxel_cone_trace(probe,cell_size,probe_pos,normalize((probe_xform * vec4(ref_vec,0.0)).xyz),0.0 ,100.0);
  611. 1062 | out_diff.a = 1.0;
  612. 1063 | return;*/
  613. 1064 | //out_diff = vec4(textureLod(probe,probe_pos*cell_size,3.0).rgb,1.0);
  614. 1065 | //return;
  615. 1066 |
  616. 1067 | //this causes corrupted pixels, i have no idea why..
  617. 1068 | if (any(bvec2(any(lessThan(probe_pos, vec3(0.0))), any(greaterThan(probe_pos, bounds))))) {
  618. 1069 | return;
  619. 1070 | }
  620. 1071 |
  621. 1072 | vec3 blendv = abs(probe_pos / bounds * 2.0 - 1.0);
  622. 1073 | float blend = clamp(1.0 - max(blendv.x, max(blendv.y, blendv.z)), 0.0, 1.0);
  623. 1074 | //float blend=1.0;
  624. 1075 |
  625. 1076 | float max_distance = length(bounds);
  626. 1077 |
  627. 1078 | //radiance
  628. 1079 | #ifdef VCT_QUALITY_HIGH
  629. 1080 |
  630. 1081 | #define MAX_CONE_DIRS 6
  631. 1082 | vec3 cone_dirs[MAX_CONE_DIRS] = vec3[](
  632. 1083 | vec3(0.0, 0.0, 1.0),
  633. 1084 | vec3(0.866025, 0.0, 0.5),
  634. 1085 | vec3(0.267617, 0.823639, 0.5),
  635. 1086 | vec3(-0.700629, 0.509037, 0.5),
  636. 1087 | vec3(-0.700629, -0.509037, 0.5),
  637. 1088 | vec3(0.267617, -0.823639, 0.5));
  638. 1
  639. 089 |
  640. 1090 | float cone_weights[MAX_CONE_DIRS] = float[](0.25, 0.15, 0.15, 0.15, 0.15, 0.15);
  641. 1091 | float cone_angle_tan = 0.577;
  642. 1092 | float min_ref_tan = 0.0;
  643. 1093 | #else
  644. 1094 |
  645. 1095 | #define MAX_CONE_DIRS 4
  646. 1096 |
  647. 1097 | vec3 cone_dirs[MAX_CONE_DIRS] = vec3[](
  648. 1098 | vec3(0.707107, 0.0, 0.707107),
  649. 1099 | vec3(0.0, 0.707107, 0.707107),
  650. 1100 | vec3(-0.707107, 0.0, 0.707107),
  651. 1101 | vec3(0.0, -0.707107, 0.707107));
  652. 1102 |
  653. 1103 | float cone_weights[MAX_CONE_DIRS] = float[](0.25, 0.25, 0.25, 0.25);
  654. 1104 | float cone_angle_tan = 0.98269;
  655. 1105 | max_distance *= 0.5;
  656. 1106 | float min_ref_tan = 0.2;
  657. 1107 |
  658. 1108 | #endif
  659. 1109 | vec3 light = vec3(0.0);
  660. 1110 | for (int i = 0; i < MAX_CONE_DIRS; i++) {
  661. 1111 | vec3 dir = normalize((probe_xform * vec4(pos + normal_mtx * cone_dirs[i], 1.0)).xyz - probe_pos);
  662. 1112 | light += cone_weights[i] * voxel_cone_trace(probe, cell_size, probe_pos, ambient, blend_ambient, dir, cone_angle_tan, max_distance, p_bias);
  663. 1113 | }
  664. 1114 |
  665. 1115 | light *= multiplier;
  666. 1116 |
  667. 1117 | out_diff += vec4(light * blend, blend);
  668. 1118 |
  669. 1119 | //irradiance
  670. 1120 |
  671. 1121 | vec3 irr_light = voxel_cone_trace(probe, cell_size, probe_pos, environment, blend_ambient, ref_vec, max(min_ref_tan, tan(roughness * 0.5 * M_PI * 0.99)), max_distance, p_bias);
  672. 1122 |
  673. 1123 | irr_light *= multiplier;
  674. 1124 | //irr_light=vec3(0.0);
  675. 1125 |
  676. 1126 | out_spec += vec4(irr_light * blend, blend);
  677. 1127 | }
  678. 1128 |
  679. 1129 | void gi_probes_compute(vec3 pos, vec3 normal, float roughness, inout vec3 out_specular, inout vec3 out_ambient) {
  680. 1130 | roughness = roughness * roughness;
  681. 1131 |
  682. 1132 | vec3 ref_vec = normalize(reflect(normalize(pos), normal));
  683. 1133 |
  684. 1134 | //find arbitrary tangent and bitangent, then build a matrix
  685. 1135 | vec3 v0 = abs(normal.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(0.0, 1.0, 0.0);
  686. 1136 | vec3 tangent = normalize(cross(v0, normal));
  687. 1137 | vec3 bitangent = normalize(cross(tangent, normal));
  688. 1138 | mat3 normal_mat = mat3(tangent, bitangent, normal);
  689. 1139 |
  690. 1140 | vec4 diff_accum = vec4(0.0);
  691. 1141 | vec4 spec_accum = vec4(0.0);
  692. 1142 |
  693. 1143 | vec3 ambient = out_ambient;
  694. 1144 | out_ambient = vec3(0.0);
  695. 1145 |
  696. 1146 | vec3 environment = out_specular;
  697. 1147 |
  698. 1148 | out_specular = vec3(0.0);
  699. 1149 |
  700. 1150 | gi_probe_compute(gi_probe1, gi_probe_xform1, gi_probe_bounds1, gi_probe_cell_size1, pos, ambient, environment, gi_probe_blend_ambient1, gi_probe_multiplier1, normal_mat, ref_vec, roughness, gi_probe_bias1, gi_probe_normal_bias1, spec_accum, diff_accum);
  701. 1151 |
  702. 1152 | if (gi_probe2_enabled) {
  703. 1153 | gi_probe_compute(gi_probe2, gi_probe_xform2, gi_probe_bounds2, gi_probe_cell_size2, pos, ambient, environment, gi_probe_blend_ambient2, gi_probe_multiplier2, normal_mat, ref_vec, roughness, gi_probe_bias2, gi_probe_normal_bias2, spec_accum, diff_accum);
  704. 1154 | }
  705. 1155 |
  706. 1156 | if (diff_accum.a > 0.0) {
  707. 1157 | diff_accum.rgb /= diff_accum.a;
  708. 1158 | }
  709. 1159 |
  710. 1160 | if (spec_accum.a > 0.0) {
  711. 1161 | spec_accum.rgb /= spec_accum.a;
  712. 1162 | }
  713. 1163 |
  714. 1164 | out_specular += spec_accum.rgb;
  715. 1165 | out_ambient += diff_accum.rgb;
  716. 1166 | }
  717. 1167 |
  718. 1168 | #endif
  719. 1169 |
  720. 1170 | void main() {
  721. 1171 | #ifdef RENDER_DEPTH_DUAL_PARABOLOID
  722. 1172 |
  723. 1173 | if (dp_clip > 0.0)
  724. 1174 | discard;
  725. 1175 | #endif
  726. 1176 |
  727. 1177 | //lay out everything, whathever is unused is optimized away anyway
  728. 1178 | highp vec3 vertex = vertex_interp;
  729. 1179 | vec3 view = -normalize(vertex_interp);
  730. 1180 | vec3 albedo = vec3(1.0);
  731. 1181 | vec3 transmission = vec3(0.0);
  732. 1182 | float metallic = 0.0;
  733. 1183 | float specular = 0.5;
  734. 1184 | vec3 emission = vec3(0.0);
  735. 1185 | float roughness = 1.0;
  736. 1186 | float rim = 0.0;
  737. 1187 | float rim_tint = 0.0;
  738. 1188 | float clearcoat = 0.0;
  739. 1189 | float clearcoat_gloss = 0.0;
  740. 1190 | float anisotropy = 0.0;
  741. 1191 | vec2 anisotropy_flow = vec2(1.0, 0.0);
  742. 1192 |
  743. 1193 | #if defined(ENABLE_AO)
  744. 1194 | float ao = 1.0;
  745. 1195 | float ao_light_affect = 0.0;
  746. 1196 | #endif
  747. 1197 |
  748. 1198 | float alpha = 1.0;
  749. 1199 |
  750. 1200 | #if defined(ALPHA_SCISSOR_USED)
  751. 1201 | float
  752. alpha_scissor = 0.5;
  753. 1202 | #endif
  754. 1203 |
  755. 1204 | #if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY)
  756. 1205 | vec3 binormal = normalize(binormal_interp);
  757. 1206 | vec3 tangent = normalize(tangent_interp);
  758. 1207 | #else
  759. 1208 | vec3 binormal = vec3(0.0);
  760. 1209 | vec3 tangent = vec3(0.0);
  761. 1210 | #endif
  762. 1211 | vec3 normal = normalize(normal_interp);
  763. 1212 |
  764. 1213 | #if defined(DO_SIDE_CHECK)
  765. 1214 | if (!gl_FrontFacing) {
  766. 1215 | normal = -normal;
  767. 1216 | }
  768. 1217 | #endif
  769. 1218 |
  770. 1219 | #if defined(ENABLE_UV_INTERP)
  771. 1220 | vec2 uv = uv_interp;
  772. 1221 | #endif
  773. 1222 |
  774. 1223 | #if defined(ENABLE_UV2_INTERP) || defined(USE_LIGHTMAP)
  775. 1224 | vec2 uv2 = uv2_interp;
  776. 1225 | #endif
  777. 1226 |
  778. 1227 | #if defined(ENABLE_COLOR_INTERP)
  779. 1228 | vec4 color = color_interp;
  780. 1229 | #endif
  781. 1230 |
  782. 1231 | #if defined(ENABLE_NORMALMAP)
  783. 1232 |
  784. 1233 | vec3 normalmap = vec3(0.5);
  785. 1234 | #endif
  786. 1235 |
  787. 1236 | float normaldepth = 1.0;
  788. 1237 |
  789. 1238 | #if defined(SCREEN_UV_USED)
  790. 1239 | vec2 screen_uv = gl_FragCoord.xy * screen_pixel_size;
  791. 1240 | #endif
  792. 1241 |
  793. 1242 | #if defined(ENABLE_SSS)
  794. 1243 | float sss_strength = 0.0;
  795. 1244 | #endif
  796. 1245 |
  797. 1246 | {
  798. 1247 | /* clang-format off */
  799. 1248 | {
  800. 1249 | vec2 m_base_uv=uv_interp;
  801. 1250 | vec4 m_albedo_tex=texture(m_texture_albedo, m_base_uv);
  802. 1251 | albedo=(m_albedo.rgb*m_albedo_tex.rgb);
  803. 1252 | metallic=m_metallic;
  804. 1253 | roughness=m_roughness;
  805. 1254 | specular=m_specular;
  806. 1255 | alpha=(m_albedo.a*m_albedo_tex.a);
  807. 1256 | }
  808. 1257 |
  809. 1258 |
  810. 1259 | /* clang-format on */
  811. 1260 | }
  812. 1261 |
  813. 1262 | #if !defined(USE_SHADOW_TO_OPACITY)
  814. 1263 |
  815. 1264 | #if defined(ALPHA_SCISSOR_USED)
  816. 1265 | if (alpha < alpha_scissor) {
  817. 1266 | discard;
  818. 1267 | }
  819. 1268 | #endif // ALPHA_SCISSOR_USED
  820. 1269 |
  821. 1270 | #ifdef USE_OPAQUE_PREPASS
  822. 1271 |
  823. 1272 | if (alpha < opaque_prepass_threshold) {
  824. 1273 | discard;
  825. 1274 | }
  826. 1275 |
  827. 1276 | #endif // USE_OPAQUE_PREPASS
  828. 1277 |
  829. 1278 | #endif // !USE_SHADOW_TO_OPACITY
  830. 1279 |
  831. 1280 | #if defined(ENABLE_NORMALMAP)
  832. 1281 |
  833. 1282 | normalmap.xy = normalmap.xy * 2.0 - 1.0;
  834. 1283 | normalmap.z = sqrt(max(0.0, 1.0 - dot(normalmap.xy, normalmap.xy))); //always ignore Z, as it can be RG packed, Z may be pos/neg, etc.
  835. 1284 |
  836. 1285 | normal = normalize(mix(normal, tangent * normalmap.x + binormal * normalmap.y + normal * normalmap.z, normaldepth));
  837. 1286 |
  838. 1287 | #endif
  839. 1288 |
  840. 1289 | #if defined(LIGHT_USE_ANISOTROPY)
  841. 1290 |
  842. 1291 | if (anisotropy > 0.01) {
  843. 1292 | //rotation matrix
  844. 1293 | mat3 rot = mat3(tangent, binormal, normal);
  845. 1294 | //make local to space
  846. 1295 | tangent = normalize(rot * vec3(anisotropy_flow.x, anisotropy_flow.y, 0.0));
  847. 1296 | binormal = normalize(rot * vec3(-anisotropy_flow.y, anisotropy_flow.x, 0.0));
  848. 1297 | }
  849. 1298 |
  850. 1299 | #endif
  851. 1300 |
  852. 1301 | #ifdef ENABLE_CLIP_ALPHA
  853. 1302 | if (albedo.a < 0.99) {
  854. 1303 | //used for doublepass and shadowmapping
  855. 1304 | discard;
  856. 1305 | }
  857. 1306 | #endif
  858. 1307 |
  859. 1308 | /////////////////////// LIGHTING //////////////////////////////
  860. 1309 |
  861. 1310 | //apply energy conservation
  862. 1311 |
  863. 1312 | #ifdef USE_VERTEX_LIGHTING
  864. 1313 |
  865. 1314 | vec3 specular_light = specular_light_interp.rgb;
  866. 1315 | vec3 diffuse_light = diffuse_light_interp.rgb;
  867. 1316 | #else
  868. 1317 |
  869. 1318 | vec3 specular_light = vec3(0.0, 0.0, 0.0);
  870. 1319 | vec3 diffuse_light = vec3(0.0, 0.0, 0.0);
  871. 1320 |
  872. 1321 | #endif
  873. 1322 |
  874. 1323 | vec3 ambient_light;
  875. 1324 | vec3 env_reflection_light = vec3(0.0, 0.0, 0.0);
  876. 1325 |
  877. 1326 | vec3 eye_vec = view;
  878. 1327 |
  879. 1328 | // IBL precalculations
  880. 1329 | float ndotv = clamp(dot(normal, eye_vec), 0.0, 1.0);
  881. 1330 | vec3 f0 = F0(metallic, specular, albedo);
  882. 1331 | vec3 F = f0 + (max(vec3(1.0 - roughness), f0) - f0) * pow(1.0 - ndotv, 5.0);
  883. 1332 |
  884. 1333 | #ifdef USE_RADIANCE_MAP
  885. 1334 |
  886. 1335 | #ifdef AMBIENT_LIGHT_DISABLED
  887. 1336 | ambient_light = vec3(0.0, 0.0, 0.0);
  888. 1337 | #else
  889. 1338 | {
  890. 1339 | { //read radiance from dual paraboloid
  891. 1340 |
  892. 1341 | vec3 ref_vec = reflect(-eye_vec, normal);
  893. 1342 | float horizon = min(1.0 + dot(ref_vec, normal), 1.0);
  894. 1343 | ref_
  895. vec = normalize((radiance_inverse_xform * vec4(ref_vec, 0.0)).xyz);
  896. 1344 | vec3 radiance = textureDualParaboloid(radiance_map, ref_vec, roughness) * bg_energy;
  897. 1345 | env_reflection_light = radiance;
  898. 1346 | env_reflection_light *= horizon * horizon;
  899. 1347 | }
  900. 1348 | }
  901. 1349 | #ifndef USE_LIGHTMAP
  902. 1350 | {
  903. 1351 | vec3 norm = normal;
  904. 1352 | norm = normalize((radiance_inverse_xform * vec4(norm, 0.0)).xyz);
  905. 1353 | norm.xy /= 1.0 + abs(norm.z);
  906. 1354 | norm.xy = norm.xy * vec2(0.5, 0.25) + vec2(0.5, 0.25);
  907. 1355 | if (norm.z > 0.0001) {
  908. 1356 | norm.y = 0.5 - norm.y + 0.5;
  909. 1357 | }
  910. 1358 |
  911. 1359 | vec3 env_ambient = texture(irradiance_map, norm.xy).rgb * bg_energy;
  912. 1360 | env_ambient *= 1.0 - F;
  913. 1361 |
  914. 1362 | ambient_light = mix(ambient_light_color.rgb, env_ambient, radiance_ambient_contribution);
  915. 1363 | }
  916. 1364 | #endif
  917. 1365 | #endif //AMBIENT_LIGHT_DISABLED
  918. 1366 |
  919. 1367 | #else
  920. 1368 |
  921. 1369 | #ifdef AMBIENT_LIGHT_DISABLED
  922. 1370 | ambient_light = vec3(0.0, 0.0, 0.0);
  923. 1371 | #else
  924. 1372 | ambient_light = ambient_light_color.rgb;
  925. 1373 | env_reflection_light = bg_color.rgb * bg_energy;
  926. 1374 | #endif //AMBIENT_LIGHT_DISABLED
  927. 1375 |
  928. 1376 | #endif
  929. 1377 |
  930. 1378 | ambient_light *= ambient_energy;
  931. 1379 |
  932. 1380 | float specular_blob_intensity = 1.0;
  933. 1381 |
  934. 1382 | #if defined(SPECULAR_TOON)
  935. 1383 | specular_blob_intensity *= specular * 2.0;
  936. 1384 | #endif
  937. 1385 |
  938. 1386 | #ifdef USE_GI_PROBES
  939. 1387 | gi_probes_compute(vertex, normal, roughness, env_reflection_light, ambient_light);
  940. 1388 |
  941. 1389 | #endif
  942. 1390 |
  943. 1391 | #ifdef USE_LIGHTMAP
  944. 1392 | #ifdef USE_LIGHTMAP_LAYERED
  945. 1393 | ambient_light = LIGHTMAP_TEXTURE_LAYERED_SAMPLE(lightmap, vec3(uv2, float(lightmap_layer))).rgb * lightmap_energy;
  946. 1394 | #else
  947. 1395 | ambient_light = LIGHTMAP_TEXTURE_SAMPLE(lightmap, uv2).rgb * lightmap_energy;
  948. 1396 | #endif
  949. 1397 | #endif
  950. 1398 |
  951. 1399 | #ifdef USE_LIGHTMAP_CAPTURE
  952. 1400 | {
  953. 1401 | vec3 cone_dirs[12] = vec3[](
  954. 1402 | vec3(0.0, 0.0, 1.0),
  955. 1403 | vec3(0.866025, 0.0, 0.5),
  956. 1404 | vec3(0.267617, 0.823639, 0.5),
  957. 1405 | vec3(-0.700629, 0.509037, 0.5),
  958. 1406 | vec3(-0.700629, -0.509037, 0.5),
  959. 1407 | vec3(0.267617, -0.823639, 0.5),
  960. 1408 | vec3(0.0, 0.0, -1.0),
  961. 1409 | vec3(0.866025, 0.0, -0.5),
  962. 1410 | vec3(0.267617, 0.823639, -0.5),
  963. 1411 | vec3(-0.700629, 0.509037, -0.5),
  964. 1412 | vec3(-0.700629, -0.509037, -0.5),
  965. 1413 | vec3(0.267617, -0.823639, -0.5));
  966. 1414 |
  967. 1415 | vec3 local_normal = normalize(camera_matrix * vec4(normal, 0.0)).xyz;
  968. 1416 | vec4 captured = vec4(0.0);
  969. 1417 | float sum = 0.0;
  970. 1418 | for (int i = 0; i < 12; i++) {
  971. 1419 | float amount = max(0.0, dot(local_normal, cone_dirs[i])); //not correct, but creates a nice wrap around effect
  972. 1420 | captured += lightmap_captures[i] * amount;
  973. 1421 | sum += amount;
  974. 1422 | }
  975. 1423 |
  976. 1424 | captured /= sum;
  977. 1425 |
  978. 1426 | // Alpha channel is used to indicate if dynamic objects keep the environment lighting
  979. 1427 | if (lightmap_captures[0].a > 0.5) {
  980. 1428 | ambient_light += captured.rgb;
  981. 1429 | } else {
  982. 1430 | ambient_light = captured.rgb;
  983. 1431 | }
  984. 1432 | }
  985. 1433 | #endif
  986. 1434 |
  987. 1435 | #ifdef USE_FORWARD_LIGHTING
  988. 1436 |
  989. 1437 | highp vec4 reflection_accum = vec4(0.0, 0.0, 0.0, 0.0);
  990. 1438 | highp vec4 ambient_accum = vec4(0.0, 0.0, 0.0, 0.0);
  991. 1439 | for (int i = 0; i < reflection_count; i++) {
  992. 1440 | reflection_process(reflection_indices[i], vertex, normal, binormal, tangent, roughness, anisotropy, ambient_light, env_reflection_light, reflection_accum, ambient_accum);
  993. 1441 | }
  994. 1442 |
  995. 1443 | if (reflection_accum.a > 0.0) {
  996. 1444 | specular_light += reflection_accum.rgb / reflection_accum.a;
  997. 1445 | } else {
  998. 1446 | specular_light += env_reflection_light;
  999. 1447 | }
  1000. 1448 | #if !defined(USE_LIGHTMAP) && !defined(USE_LIGHTMAP_CAPTURE)
  1001. 1449 | if (ambient_accum.a > 0.0) {
  1002. 1450 | ambient_light = ambient_accum.rgb / ambient_accum.a;
  1003. 1451 | }
  1004. 1452 | #endif
  1005. 1453 | #endif
  1006. 1454 |
  1007. 1455 | {
  1008. 1456 | #if defined(DIFFUSE_TOON)
  1009. 1457 | //simplify for toon, as
  1010. 1458 | specular_light *= specula
  1011. r * metallic * albedo * 2.0;
  1012. 1459 | #else
  1013. 1460 |
  1014. 1461 | // scales the specular reflections, needs to be be computed before lighting happens,
  1015. 1462 | // but after environment, GI, and reflection probes are added
  1016. 1463 | // Environment brdf approximation (Lazarov 2013)
  1017. 1464 | // see https://www.unrealengine.com/en-US/blog/physically-based-shading-on-mobile
  1018. 1465 | const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
  1019. 1466 | const vec4 c1 = vec4(1.0, 0.0425, 1.04, -0.04);
  1020. 1467 | vec4 r = roughness * c0 + c1;
  1021. 1468 | float a004 = min(r.x * r.x, exp2(-9.28 * ndotv)) * r.x + r.y;
  1022. 1469 | vec2 env = vec2(-1.04, 1.04) * a004 + r.zw;
  1023. 1470 | specular_light *= env.x * F + env.y;
  1024. 1471 | #endif
  1025. 1472 | }
  1026. 1473 |
  1027. 1474 | #if defined(USE_LIGHT_DIRECTIONAL)
  1028. 1475 |
  1029. 1476 | vec3 light_attenuation = vec3(1.0);
  1030. 1477 |
  1031. 1478 | float depth_z = -vertex.z;
  1032. 1479 | #ifdef LIGHT_DIRECTIONAL_SHADOW
  1033. 1480 | #if !defined(SHADOWS_DISABLED)
  1034. 1481 |
  1035. 1482 | #ifdef LIGHT_USE_PSSM4
  1036. 1483 | if (depth_z < shadow_split_offsets.w) {
  1037. 1484 | #elif defined(LIGHT_USE_PSSM2)
  1038. 1485 | if (depth_z < shadow_split_offsets.y) {
  1039. 1486 | #else
  1040. 1487 | if (depth_z < shadow_split_offsets.x) {
  1041. 1488 | #endif //LIGHT_USE_PSSM4
  1042. 1489 |
  1043. 1490 | vec3 pssm_coord;
  1044. 1491 | float pssm_fade = 0.0;
  1045. 1492 |
  1046. 1493 | #ifdef LIGHT_USE_PSSM_BLEND
  1047. 1494 | float pssm_blend;
  1048. 1495 | vec3 pssm_coord2;
  1049. 1496 | bool use_blend = true;
  1050. 1497 | #endif
  1051. 1498 |
  1052. 1499 | #ifdef LIGHT_USE_PSSM4
  1053. 1500 |
  1054. 1501 | if (depth_z < shadow_split_offsets.y) {
  1055. 1502 | if (depth_z < shadow_split_offsets.x) {
  1056. 1503 | highp vec4 splane = (shadow_matrix1 * vec4(vertex, 1.0));
  1057. 1504 | pssm_coord = splane.xyz / splane.w;
  1058. 1505 |
  1059. 1506 | #if defined(LIGHT_USE_PSSM_BLEND)
  1060. 1507 |
  1061. 1508 | splane = (shadow_matrix2 * vec4(vertex, 1.0));
  1062. 1509 | pssm_coord2 = splane.xyz / splane.w;
  1063. 1510 | pssm_blend = smoothstep(0.0, shadow_split_offsets.x, depth_z);
  1064. 1511 | #endif
  1065. 1512 |
  1066. 1513 | } else {
  1067. 1514 | highp vec4 splane = (shadow_matrix2 * vec4(vertex, 1.0));
  1068. 1515 | pssm_coord = splane.xyz / splane.w;
  1069. 1516 |
  1070. 1517 | #if defined(LIGHT_USE_PSSM_BLEND)
  1071. 1518 | splane = (shadow_matrix3 * vec4(vertex, 1.0));
  1072. 1519 | pssm_coord2 = splane.xyz / splane.w;
  1073. 1520 | pssm_blend = smoothstep(shadow_split_offsets.x, shadow_split_offsets.y, depth_z);
  1074. 1521 | #endif
  1075. 1522 | }
  1076. 1523 | } else {
  1077. 1524 | if (depth_z < shadow_split_offsets.z) {
  1078. 1525 | highp vec4 splane = (shadow_matrix3 * vec4(vertex, 1.0));
  1079. 1526 | pssm_coord = splane.xyz / splane.w;
  1080. 1527 |
  1081. 1528 | #if defined(LIGHT_USE_PSSM_BLEND)
  1082. 1529 | splane = (shadow_matrix4 * vec4(vertex, 1.0));
  1083. 1530 | pssm_coord2 = splane.xyz / splane.w;
  1084. 1531 | pssm_blend = smoothstep(shadow_split_offsets.y, shadow_split_offsets.z, depth_z);
  1085. 1532 | #endif
  1086. 1533 |
  1087. 1534 | } else {
  1088. 1535 | highp vec4 splane = (shadow_matrix4 * vec4(vertex, 1.0));
  1089. 1536 | pssm_coord = splane.xyz / splane.w;
  1090. 1537 | pssm_fade = smoothstep(shadow_split_offsets.z, shadow_split_offsets.w, depth_z);
  1091. 1538 |
  1092. 1539 | #if defined(LIGHT_USE_PSSM_BLEND)
  1093. 1540 | use_blend = false;
  1094. 1541 |
  1095. 1542 | #endif
  1096. 1543 | }
  1097. 1544 | }
  1098. 1545 |
  1099. 1546 | #endif //LIGHT_USE_PSSM4
  1100. 1547 |
  1101. 1548 | #ifdef LIGHT_USE_PSSM2
  1102. 1549 |
  1103. 1550 | if (depth_z < shadow_split_offsets.x) {
  1104. 1551 | highp vec4 splane = (shadow_matrix1 * vec4(vertex, 1.0));
  1105. 1552 | pssm_coord = splane.xyz / splane.w;
  1106. 1553 |
  1107. 1554 | #if defined(LIGHT_USE_PSSM_BLEND)
  1108. 1555 |
  1109. 1556 | splane = (shadow_matrix2 * vec4(vertex, 1.0));
  1110. 1557 | pssm_coord2 = splane.xyz / splane.w;
  1111. 1558 | pssm_blend = smoothstep(0.0, shadow_split_offsets.x, depth_z);
  1112. 1559 | #endif
  1113. 1560 |
  1114. 1561 | } else {
  1115. 1562 | highp vec4 splane = (shadow_matrix2 * vec4(vertex, 1.0));
  1116. 1563 | pssm_coord = splane.xyz / splane.w;
  1117. 1564 | pssm_fade = smoothstep(shadow_split_offsets.x, shadow_split_offsets.y, depth_z);
  1118. 1565 | #if defined(LIGHT_USE_PSSM_BLEND)
  1119. 1566 | use_blend = false;
  1120. 1567 |
  1121. 1568 | #endif
  1122. 1569 | }
  1123. 1570 |
  1124. 1571 | #endif //LIGHT_USE_PSSM2
  1125. 1572 |
  1126. 1573 | #if !defined(LIGHT_USE_PSSM4) && !defined(LIGHT_USE_PSSM2)
  1127. 1574 |
  1128. { //regular orthogonal
  1129. 1575 | highp vec4 splane = (shadow_matrix1 * vec4(vertex, 1.0));
  1130. 1576 | pssm_coord = splane.xyz / splane.w;
  1131. 1577 | }
  1132. 1578 | #endif
  1133. 1579 |
  1134. 1580 | //one one sample
  1135. 1581 |
  1136. 1582 | float shadow = sample_shadow(directional_shadow, directional_shadow_pixel_size, pssm_coord.xy, pssm_coord.z, light_clamp);
  1137. 1583 |
  1138. 1584 | #if defined(LIGHT_USE_PSSM_BLEND)
  1139. 1585 |
  1140. 1586 | if (use_blend) {
  1141. 1587 | shadow = mix(shadow, sample_shadow(directional_shadow, directional_shadow_pixel_size, pssm_coord2.xy, pssm_coord2.z, light_clamp), pssm_blend);
  1142. 1588 | }
  1143. 1589 | #endif
  1144. 1590 |
  1145. 1591 | #ifdef USE_CONTACT_SHADOWS
  1146. 1592 | if (shadow > 0.01 && shadow_color_contact.a > 0.0) {
  1147. 1593 | float contact_shadow = contact_shadow_compute(vertex, -light_direction_attenuation.xyz, shadow_color_contact.a);
  1148. 1594 | shadow = min(shadow, contact_shadow);
  1149. 1595 | }
  1150. 1596 | #endif
  1151. 1597 | light_attenuation = mix(mix(shadow_color_contact.rgb, vec3(1.0), shadow), vec3(1.0), pssm_fade);
  1152. 1598 | }
  1153. 1599 |
  1154. 1600 | #endif // !defined(SHADOWS_DISABLED)
  1155. 1601 | #endif //LIGHT_DIRECTIONAL_SHADOW
  1156. 1602 |
  1157. 1603 | #ifdef USE_VERTEX_LIGHTING
  1158. 1604 | diffuse_light *= mix(vec3(1.0), light_attenuation, diffuse_light_interp.a);
  1159. 1605 | specular_light *= mix(vec3(1.0), light_attenuation, specular_light_interp.a);
  1160. 1606 |
  1161. 1607 | #else
  1162. 1608 | light_compute(normal, -light_direction_attenuation.xyz, eye_vec, binormal, tangent, light_color_energy.rgb, light_attenuation, albedo, transmission, light_params.z * specular_blob_intensity, roughness, metallic, specular, rim, rim_tint, clearcoat, clearcoat_gloss, anisotropy, diffuse_light, specular_light, alpha);
  1163. 1609 | #endif
  1164. 1610 |
  1165. 1611 | #endif //#USE_LIGHT_DIRECTIONAL
  1166. 1612 |
  1167. 1613 | #ifdef USE_VERTEX_LIGHTING
  1168. 1614 | diffuse_light *= albedo;
  1169. 1615 | #endif
  1170. 1616 |
  1171. 1617 | #ifdef USE_FORWARD_LIGHTING
  1172. 1618 |
  1173. 1619 | #ifndef USE_VERTEX_LIGHTING
  1174. 1620 |
  1175. 1621 | for (int i = 0; i < omni_light_count; i++) {
  1176. 1622 | light_process_omni(omni_light_indices[i], vertex, eye_vec, normal, binormal, tangent, albedo, transmission, roughness, metallic, specular, rim, rim_tint, clearcoat, clearcoat_gloss, anisotropy, specular_blob_intensity, diffuse_light, specular_light, alpha);
  1177. 1623 | }
  1178. 1624 |
  1179. 1625 | for (int i = 0; i < spot_light_count; i++) {
  1180. 1626 | light_process_spot(spot_light_indices[i], vertex, eye_vec, normal, binormal, tangent, albedo, transmission, roughness, metallic, specular, rim, rim_tint, clearcoat, clearcoat_gloss, anisotropy, specular_blob_intensity, diffuse_light, specular_light, alpha);
  1181. 1627 | }
  1182. 1628 |
  1183. 1629 | #endif //USE_VERTEX_LIGHTING
  1184. 1630 |
  1185. 1631 | #endif
  1186. 1632 |
  1187. 1633 | #ifdef USE_SHADOW_TO_OPACITY
  1188. 1634 | alpha = min(alpha, clamp(length(ambient_light), 0.0, 1.0));
  1189. 1635 |
  1190. 1636 | #if defined(ALPHA_SCISSOR_USED)
  1191. 1637 | if (alpha < alpha_scissor) {
  1192. 1638 | discard;
  1193. 1639 | }
  1194. 1640 | #endif // ALPHA_SCISSOR_USED
  1195. 1641 |
  1196. 1642 | #ifdef USE_OPAQUE_PREPASS
  1197. 1643 |
  1198. 1644 | if (alpha < opaque_prepass_threshold) {
  1199. 1645 | discard;
  1200. 1646 | }
  1201. 1647 |
  1202. 1648 | #endif // USE_OPAQUE_PREPASS
  1203. 1649 |
  1204. 1650 | #endif // USE_SHADOW_TO_OPACITY
  1205. 1651 |
  1206. 1652 | #ifdef RENDER_DEPTH
  1207. 1653 | //nothing happens, so a tree-ssa optimizer will result in no fragment shader :)
  1208. 1654 | #else
  1209. 1655 |
  1210. 1656 | specular_light *= reflection_multiplier;
  1211. 1657 | ambient_light *= albedo; //ambient must be multiplied by albedo at the end
  1212. 1658 |
  1213. 1659 | #if defined(ENABLE_AO)
  1214. 1660 | ambient_light *= ao;
  1215. 1661 | ao_light_affect = mix(1.0, ao, ao_light_affect);
  1216. 1662 | specular_light *= ao_light_affect;
  1217. 1663 | diffuse_light *= ao_light_affect;
  1218. 1664 | #endif
  1219. 1665 |
  1220. 1666 | // base color remapping
  1221. 1667 | diffuse_light *= 1.0 - metallic; // TODO: avoid all diffuse and ambient light calculations when metallic == 1 up to this point
  1222. 1668 | ambient_light *= 1.0 - metallic;
  1223. 1669 |
  1224. 1670 | if (fog_color_enabled.a > 0.5) {
  1225. 1671 | float fog_amount = 0.0;
  1226. 1672 |
  1227. 1673 | #ifdef USE_LIGHT_DIRECTIONAL
  1228. 1674 |
  1229. 1675 | vec3 fog_color = mix(fog_color_enabled.rgb, fog_sun_color_amount.rgb, fog_sun_color_amount.a * pow(max(dot(normalize(v
  1230. ertex), -light_direction_attenuation.xyz), 0.0), 8.0));
  1231. 1676 | #else
  1232. 1677 |
  1233. 1678 | vec3 fog_color = fog_color_enabled.rgb;
  1234. 1679 | #endif
  1235. 1680 |
  1236. 1681 | //apply fog
  1237. 1682 |
  1238. 1683 | if (fog_depth_enabled) {
  1239. 1684 | float fog_far = fog_depth_end > 0.0 ? fog_depth_end : z_far;
  1240. 1685 |
  1241. 1686 | float fog_z = smoothstep(fog_depth_begin, fog_far, length(vertex));
  1242. 1687 |
  1243. 1688 | fog_amount = pow(fog_z, fog_depth_curve) * fog_density;
  1244. 1689 | if (fog_transmit_enabled) {
  1245. 1690 | vec3 total_light = emission + ambient_light + specular_light + diffuse_light;
  1246. 1691 | float transmit = pow(fog_z, fog_transmit_curve);
  1247. 1692 | fog_color = mix(max(total_light, fog_color), fog_color, transmit);
  1248. 1693 | }
  1249. 1694 | }
  1250. 1695 |
  1251. 1696 | if (fog_height_enabled) {
  1252. 1697 | float y = (camera_matrix * vec4(vertex, 1.0)).y;
  1253. 1698 | fog_amount = max(fog_amount, pow(smoothstep(fog_height_min, fog_height_max, y), fog_height_curve));
  1254. 1699 | }
  1255. 1700 |
  1256. 1701 | float rev_amount = 1.0 - fog_amount;
  1257. 1702 |
  1258. 1703 | emission = emission * rev_amount + fog_color * fog_amount;
  1259. 1704 | ambient_light *= rev_amount;
  1260. 1705 | specular_light *= rev_amount;
  1261. 1706 | diffuse_light *= rev_amount;
  1262. 1707 | }
  1263. 1708 |
  1264. 1709 | #ifdef USE_MULTIPLE_RENDER_TARGETS
  1265. 1710 |
  1266. 1711 | #ifdef SHADELESS
  1267. 1712 | diffuse_buffer = vec4(albedo.rgb, 0.0);
  1268. 1713 | specular_buffer = vec4(0.0);
  1269. 1714 |
  1270. 1715 | #else
  1271. 1716 |
  1272. 1717 | //approximate ambient scale for SSAO, since we will lack full ambient
  1273. 1718 | float max_emission = max(emission.r, max(emission.g, emission.b));
  1274. 1719 | float max_ambient = max(ambient_light.r, max(ambient_light.g, ambient_light.b));
  1275. 1720 | float max_diffuse = max(diffuse_light.r, max(diffuse_light.g, diffuse_light.b));
  1276. 1721 | float total_ambient = max_ambient + max_diffuse;
  1277. 1722 | #ifdef USE_FORWARD_LIGHTING
  1278. 1723 | total_ambient += max_emission;
  1279. 1724 | #endif
  1280. 1725 | float ambient_scale = (total_ambient > 0.0) ? (max_ambient + ambient_occlusion_affect_light * max_diffuse) / total_ambient : 0.0;
  1281. 1726 |
  1282. 1727 | #if defined(ENABLE_AO)
  1283. 1728 | ambient_scale = mix(0.0, ambient_scale, ambient_occlusion_affect_ao_channel);
  1284. 1729 | #endif
  1285. 1730 | diffuse_buffer = vec4(diffuse_light + ambient_light, ambient_scale);
  1286. 1731 | specular_buffer = vec4(specular_light, metallic);
  1287. 1732 |
  1288. 1733 | #ifdef USE_FORWARD_LIGHTING
  1289. 1734 | diffuse_buffer.rgb += emission;
  1290. 1735 | #endif
  1291. 1736 | #endif //SHADELESS
  1292. 1737 |
  1293. 1738 | normal_mr_buffer = vec4(normalize(normal) * 0.5 + 0.5, roughness);
  1294. 1739 |
  1295. 1740 | #if defined(ENABLE_SSS)
  1296. 1741 | sss_buffer = sss_strength;
  1297. 1742 | #endif
  1298. 1743 |
  1299. 1744 | #else //USE_MULTIPLE_RENDER_TARGETS
  1300. 1745 |
  1301. 1746 | #ifdef SHADELESS
  1302. 1747 | frag_color = vec4(albedo, alpha);
  1303. 1748 | #else
  1304. 1749 | frag_color = vec4(ambient_light + diffuse_light + specular_light, alpha);
  1305. 1750 | #ifdef USE_FORWARD_LIGHTING
  1306. 1751 | frag_color.rgb += emission;
  1307. 1752 | #endif
  1308. 1753 | #endif //SHADELESS
  1309. 1754 |
  1310. 1755 | #endif //USE_MULTIPLE_RENDER_TARGETS
  1311. 1756 |
  1312. 1757 | #endif //RENDER_DEPTH
  1313. 1758 | }
  1314. 1759 |
  1315. Placing organelle 'cytoplasm' at: 0, -1
  1316. Placing organelle 'cytoplasm' at: 0, -1
  1317. Placing organelle 'cytoplasm' at: 0, -2
  1318. Placing organelle 'cytoplasm' at: 1, -3
  1319. Placing organelle 'cytoplasm' at: 1, -4
  1320. MicrobeEditor: applying changes to edited Species
  1321. MicrobeEditorReportComponent: applying changes of component
  1322. MicrobeEditorPatchMap: applying changes of component
  1323. CellEditorComponent: applying changes of component
  1324. Edited species name is now Primum Thrivium
  1325. MicrobeEditor: updated organelles for species: Primum Thrivium
  1326. Applying patch (Karronon Volcanic Vent) settings
  1327. Number of clouds in this patch = 8
  1328. oxygen spawn density is 0. It won't spawn
  1329. carbondioxide spawn density is 0. It won't spawn
  1330. nitrogen spawn density is 0. It won't spawn
  1331. sunlight spawn density is 0. It won't spawn
  1332. Number of chunks in this patch = 4
  1333. MARINE_SNOW spawn density is 0. It won't spawn
  1334. Number of species in this patch = 2
  1335. Jukebox now playing from: MicrobeStage
  1336. Jukebox: starting track: res://assets/sounds/microbe-theme-4.ogg position: 0
  1337. Jukebox: starting track: res://assets/sounds/soundeffects
  1338. /microbe-ambience2.ogg position: 0
  1339. Creating a save with name: auto_save_2.thrivesave
  1340. save finished, success: True message: Saving succeeded elapsed: 00:00:02.1639661
  1341. Jukebox: starting track: res://assets/sounds/microbe-theme-1.ogg position: 20.30585
  1342. Jukebox: starting track: res://assets/sounds/soundeffects/microbe-ambience-3.ogg position: 4.762667
  1343. get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: SceneShaderGLES3: Program LINK FAILED: Fragment shader(s) failed to link, Vertex shader(s) linked. Fragment Shader not supported by HWWARNING: warning(#276) Symbol 'position_interp' usage doesn't match between two stages at: _display_error_with_code (drivers/gles3/shader_gles3.cpp:156) ERROR: SceneShaderGLES3: Program LINK FAILED: Fragment shader(s) failed to link, Vertex shader(s) linked. Fragment Shader not supported by HWWARNING: warning(#276) Symbol 'position_interp' usage doesn't match between two stages at: get_current_version (drivers/gles3/shader_gles3.cpp:478) ERROR: Method failed. Returning: nullptr at: get_current_version (drivers/gles3/shader_gles3.cpp:485) ERROR: Condition "!version" is true. Returned: false at: bind (drivers/gles3/shader_gles3.cpp:118) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: SceneShaderGLES3: Program LINK FAILED: Fragment shader(s) failed to link, Vertex shader(s) linked. Fragment Shader not supported by HWWARNING: warning(#276) Symbol 'position_interp' usage doesn't match between two stages at: _display_error_with_code (drivers/gles3/shader_gles3.cpp:156) ERROR: SceneShaderGLES3: Program LINK FAILED: Fragment shader(s) failed to link, Vertex shader(s) linked. Fragment Shader not supported by HWWARNING: warning(#276) Symbol 'position_interp' usage doesn't match between two stages at: get_current_version (drivers/gles3/shader_gles3.cpp:478) ERROR: Method failed. Returning: nullptr at: get_current_version (drivers/gles3/shader_gles3.cpp:485) ERROR: Condition "!version" is true. Returned: false at: bind (drivers/gles3/shader_gles3.cpp:118) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362) ERROR: Condition "!version" is true. Returned: -1 at: _get_uniform (drivers/gles3/shader_gles3.h:362)
  1344. child process exited with code 0
  1345. Thrive has exited normally (exit code 0)
Advertisement
Add Comment
Please, Sign In to add comment