Hello,
Just wanted to share my improved DModelPanel that fixes the model leaking outside of the bounds of the panel.
Credits belong to garry for creating the DModelPanel ;)
Download:
[url]http://perpheads.com/downloads/dmodelpanel_improved.zip[/url]
Small FAQ:
What does this do?
It calculates the area of the panel that is visible and restricts the render to only draw into that area.
Using the normal DModelPanel:
[IMG]http://puu.sh/758IW/5d15faf5aa.jpg[/IMG]
Using the modified DModelPanel:
[IMG]http://puu.sh/758if/de6c29e3c8.jpg[/IMG]
I found a mistake in your script:
Please let me know in the thread so I can fix it ;)
Will this affect the performance:
Unless your dmodelpanel has 1000 parents this won't make any significant difference.
How is this different from that solution: [url]http://facepunch.com/showthread.php?t=1285791[/url] ?
The solution shown there is actually just a bad workaround. If the parent of your DModelPanel is itself
being outside of the bounds of it's parent, the same problem occurs, which renders that workaround completely useless.
You also have to know which parent to use for the scissor rect, which is not necessary using my solution
Scissor rect of the other solution in case of the the melon's dmodelpanel (Blue represents the scissor rect):
[url]http://puu.sh/75GjK/d27007993c.jpg[/url]
Using this modelpanel:
[url]http://perpheads.com/downloads/dmodelpanel_improved.png[/url]
(Purple = scissor rect, blue = original area being drawn to)
[url]http://perpheads.com/downloads/dmodelpanel_improved_2.png[/url]
syl0r
Cool...I guess?
Wow, nice release for an issue that otherwise annoys me, thanks so much!
Is that PERP? :suicide:
[QUOTE=-Natekit-;44003451]Is that PERP? :suicide:[/QUOTE]
According to the download link it is :P
I forgot what it looked like after I remade it xD
[QUOTE=-Natekit-;44005273]I forgot what it looked like after I remade it xD[/QUOTE]
Does it really matter what gamemode those pictures are from?
Btw. I fixed some small things so if you already downloaded it you might want to use this new version
This would be nice if included with the game by default.
Maybe put in a pull request?
I probably will when I am sure there is no mistake in my code ;)
Thanks for sharing this, could be quite useful!
Fantastic, the provided fix from the other thread wasn't working for me, but alas you've nailed it!
Why didn't you just submit a pull request on the Garry's mod git repository?
[QUOTE=BlackVoid;44693757]Why didn't you just submit a pull request on the Garry's mod git repository?[/QUOTE]
[url]https://github.com/garrynewman/garrysmod/pull/626[/url]
Sorry, you need to Log In to post a reply to this thread.