Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Correct way to make entity with opacity depending on distance to player

#1
Hello. I'm trying to implement objects which are visible when you are close to them and are fading out when you're going from them (similar behavior you can find in some puzzle games, such as Antichamber). The first thought was about shaders, but the only thing I've found is "AlphaGen portal" which is not supported by DP. The second idea was about entity like func_wall but with alpha depending on distance from player. I've remembered about warpzone fadeout, looked at sources and tried to implement it like it's implemented in trigger_warpzone. The code became complicated and after all this entity isn't shown at all (not because of alpha (it's not even set), but because I'm doing something wrong).

So, the question is what is the correct way to implement this? Should I continue looking at sources of warpzones and other entities or is there simple way to update entitie's alpha? I understand that such entitiy is not very useful for Xonotic, but there is not much related information in Internet. Also, sorry for weird English.
Reply

#2
There is currently no shared handling of such fading.

The version in warpzones is the only fading function existing, I recently copied it for use with items (greatly improves performance to not render all items at once):
https://gitlab.com/xonotic/xonotic-data....e8ca1810db
[Image: 230.png]
Reply

#3
Quote:The version in warpzones is the only fading function existing, I recently copied it for use with items (greatly improves performance to not render all items at once):
https://gitlab.com/xonotic/xonotic-data....e8ca1810db

Thank you, this helped a lot.
Reply



Possibly Related Threads...
Thread Author Replies Views Last Post
Question [SOLVED] model not moving with entity dingus 1 1,258 07-30-2016, 02:37 PM
Last Post: Mario
  [plan] A single-player game creation toolkit using the Xonotic framework MirceaKitsune 21 21,846 06-18-2013, 10:15 AM
Last Post: Zeo
  ex textures and gpl ...... the post that will probably make everyone hate me .... hutty 16 8,847 11-06-2012, 01:54 PM
Last Post: Mr. Bougo
  How to make new weapons? Kris 2 2,908 09-30-2012, 08:56 AM
Last Post: Mr. Bougo
  Improving Xonotic packaging and compression to make the download smaller edh 19 17,125 08-25-2012, 04:47 PM
Last Post: edh
  We need more alien and robot player models! MirceaKitsune 25 19,531 11-17-2011, 10:03 PM
Last Post: Lee_Stricklin
Question How do I create IQM player models for Xonotic? Ihsan 4 5,561 06-20-2011, 06:53 PM
Last Post: nifrek
  bug: CTS player lacks UID => record lost Sze 7 6,276 04-11-2011, 08:44 AM
Last Post: Sze
  Help with Player scoring Cvars Dokujisan 2 3,038 03-07-2011, 02:37 PM
Last Post: nowego4
  Xonotic Installer - I'll make. Minkovsky 20 15,882 11-28-2010, 01:34 AM
Last Post: -z-

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-