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.jpg]
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 2,694 07-30-2016, 02:37 PM
Last Post: Mario
  ex textures and gpl ...... the post that will probably make everyone hate me .... hutty 16 16,255 11-06-2012, 01:54 PM
Last Post: Mr. Bougo
  How to make new weapons? Kris 2 5,001 09-30-2012, 08:56 AM
Last Post: Mr. Bougo
  Improving Xonotic packaging and compression to make the download smaller edh 19 26,304 08-25-2012, 04:47 PM
Last Post: edh
  Xonotic Installer - I'll make. Minkovsky 20 24,317 11-28-2010, 01:34 AM
Last Post: -z-
  "Global player stats tracking system, supporting anonymous player as well" atheros 30 33,994 06-18-2010, 03:57 PM
Last Post: unfa

Forum Jump:


Users browsing this thread:
1 Guest(s)

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