Garry's Mod

Garry's Mod

35 个评价
[E2] Stencil Core
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 工具
插件标签: 建筑, 风景
文件大小
发表于
更新日期
4.424 KB
2019 年 10 月 25 日 下午 7:04
2019 年 11 月 22 日 下午 6:50
14 项改动说明 ( 查看 )

订阅以下载
[E2] Stencil Core

描述
This addon was rewritten to improve performance and capability! Get it here: https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2944110226
Please note, this version is incompatible with the rewritten version above.

An extension for WireMod Expression 2 that allows Expression 2 to use render entities with stencils and allows some (currently) minor customization of the stencils. Also, since it works for any entities a player has access to, it can be applied to players (normally the owner), holograms, and of course props.

WireMod

Functions
stencilAddEntity - Add an entity to the specified stencil's render stencilAddReferenceEntity - Add an entity to use as the stencil stencilColor - Change the color of the pixels written when clearing the buffer (only affects _STENCIL_WHITELIST) stencilCreate - Create a stencil with the specified index stencilGetEntities - Returns the indices of all entities added to a specified stencil stencilGetReferenceEntities - Returns the indices of all entities that are used as the stencil stencilRemove - Delete a stencil stencilRemoveEntity - Remove an entity from the stencil's render stencilRemoveReferenceEntity - Remove the entities which are used as the stencil stencilType - Change the stencil preset
Convars
wire_stencils_max (10) - Maximum amount of stencil declarations per chip wire_stencils_max_entities (200) - Maximum amount of entities for the entire chip. This is not just the renderable entities, but also the reference
FAQ
Why are entities in a blacklist stencil flickering when my toolgun is out?
I'm not sure. It's a bug I hope to fix, but for right now it is not priority.

Can you use this to go through walls?
Can you shoot through these?
Can props go through them?

No*, no, and if they're nocollided.

Why can't they be used for manipulating/disabling collisions?
*Stencils are just a feature that is part of GMod Lua's render library[wiki.garrysmod.com]. If you want to use these for projects like making interiors inside solid buildings, then I recommend using Gravity Hull as it is your best choice and it is decently common.
热门讨论 查看全部(1)
3
2020 年 3 月 24 日 下午 6:48
Stencil examples
Spectrox
17 条留言
1gabriel5 2024 年 10 月 3 日 下午 7:12 
Im new to gmod coding, Can i have the code in the 2nd picture to modify it? @cryotheum
cryotheum  [作者] 2022 年 9 月 6 日 上午 12:59 
Thank you for giving me a heads up!
Vurv 2022 年 9 月 6 日 上午 12:27 
This is a notice that some functionality this extension will likely be broken by wiremod/wire#2399 if you don't convert your ``e2function``s to return proper ``Vector`` and ``Angle`` userdata rather than tables of three numbers.

This is a copy pasted message, I cba to download the addon and check myself if it does contain use of these. Feel free to delete if this is non-applicable.
cryotheum  [作者] 2022 年 6 月 10 日 下午 12:23 
Thank you for the advice!
kilo 2022 年 6 月 10 日 上午 6:38 
Thank you for your response. For now i've followed you on github to watch any progress. Good luck on your other projects. A tip i like to give anyone with loads of projects is if you've hit a block. Step away don't think about it then come back to it later. Don't burn yourself out! Good luck and i look forward to seeing your work.
cryotheum  [作者] 2022 年 6 月 9 日 下午 5:52 
Part 2:
Additionally, the _STENCIL_WHITELIST_MATERIAL stencil would draw a material where the stencil passed instead of clearing the buffer with a color. This was cut because when I had made this addon I was still learning and didn't know how to validate a material's safety.

Do not expect the second version of the core to come out soon, as I have a ~4 projects queued up in front of it, and most of them are big projects.
cryotheum  [作者] 2022 年 6 月 9 日 下午 5:52 
Part 1:
Oops... that wasn't supposed to be in the example.
That type of stencil was fundamentally impossible to design in a performant method with how I wrote this core, so I gave up. Version 2 of this core has a much more robust and optimized architecture, and I plan to let players use something similar to what the _STENCIL_RENDER_TARGET stencils could do but with the control of convars to prevent abuse.

If you're wondering what it did, originally it used a render target of the current view with a further near clipping plane where the stencil passed. This was used to make windows through world geometry that still rendered the world. Basically, Lexicality's portable window addon.
kilo 2022 年 6 月 8 日 上午 8:02 
How do i use: _STENCIL_RENDER_TARGET ?
It is mentioned in a comment in the example but there is no enum?
The Big Jewbowski 2021 年 10 月 27 日 上午 11:11 
Understandable. My server staff have been begging me to add it. If you're also interested in doing some side development for a sandbox server, let me know our other dev (you might know him) got hit with school.
cryotheum  [作者] 2021 年 10 月 27 日 上午 4:06 
It's because I made this addon unlisted.
You don't want this in your addon collection, trust me. It's broken due to neglect. It doesn't cause script errors but it's bad enough that I am making a rewrite. The rewrite I'm making should be a lot easier for players to use, and won't have the bugs this one does. But in case you still REALLY want this in your collection, I'll make it publicly visible.