Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Feedback Suggestions and improvements v
1 2 3 4 5 … 36 Next »
Possible suggestion as to workaround shearing's lighting issues
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Possible suggestion as to workaround shearing's lighting issues
20-01-2023, 02:48 PM,
#1
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
Possible suggestion as to workaround shearing's lighting issues
We've learned to just go by the fact that shearing modifies lighting in ways that are not necessarily wanted. I tried asking on the garrysmod-issues github for a possible fix with sadly no answer from facepunch.
However, someone on my thread raised the interesting fact that it could be intentional if shearing (enableMatrix) also was shearing normals.

So my thought was that if enableMatrix was shearing normals in a certain way, wouldnt recalculating the normals by multiplying them by the inverse matrix and feeding that to the entity as its new normals could potentially work around those lighting issues ?


Purely a thought, there might be many strings attached that I dont see as I dont have much experience with GLua in general, but thought I'd put that here.
Tell me what you think and if this would work.

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
20-01-2023, 07:12 PM,
#2
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Possible suggestion as to workaround shearing's lighting issues
The normals are only part of how VertexLitGeneric materials calculate lighting. There's also tangent data which is likely being modified by the shearing too. Inverting this back to the original wouldn't produce the right results, the surfaces have changed so their normals should point in the new direction and their tangents should also be updated.

However, there's no easy way to alter the visual mesh of arbitrary entities in a way that properly respects lighting. Just drawing a mesh instead of the entity will likely still mess up lighting. There's an entity hook for it specifically to allow custom meshes to be lit properly, but that's only called for scripted entities, some of which will already be using it internally. Ideally there'd be an Entity:SetMesh() method to override any entity's model with a mesh, but that doesn't exist.

There might be a few others things I could try, but it gets into the realms of major hacks pretty quickly. Maybe at some point I can try to see if I can correct the lighting on a dummy entity with shearing first, then if that works maybe it would be worth the hacks needed to override entity rendering.
Find
Reply
20-01-2023, 09:56 PM,
#3
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
RE: Possible suggestion as to workaround shearing's lighting issues
(20-01-2023, 07:12 PM)Person8880 Wrote: [...] Ideally there'd be an Entity:SetMesh() method to override any entity's model with a mesh, but that doesn't exist.

This might be something global enough and interesting enough for everyone (not TSCM alone) to suggest, I might suggest it on gmod's suggestion repo

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
21-01-2023, 09:40 AM,
#4
mariofludd Offline
Novaaaaaaaaaaaaa
****
Posts: 528
Threads: 44
Joined: Dec 2013
RE: Possible suggestion as to workaround shearing's lighting issues
(20-01-2023, 09:56 PM)The17thDoctor Wrote:
(20-01-2023, 07:12 PM)Person8880 Wrote: [...] Ideally there'd be an Entity:SetMesh() method to override any entity's model with a mesh, but that doesn't exist.

This might be something global enough and interesting enough for everyone (not TSCM alone) to suggest, I might suggest it on gmod's suggestion repo

if you dont need to change gmod's binaries to do it, you can make it, and then make a PR in gmod's actual repo

[Image: efN9HsZ.png]
Find
Reply
21-01-2023, 02:29 PM,
#5
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
RE: Possible suggestion as to workaround shearing's lighting issues
(21-01-2023, 09:40 AM)mariofludd Wrote:
(20-01-2023, 09:56 PM)The17thDoctor Wrote:
(20-01-2023, 07:12 PM)Person8880 Wrote: [...] Ideally there'd be an Entity:SetMesh() method to override any entity's model with a mesh, but that doesn't exist.

This might be something global enough and interesting enough for everyone (not TSCM alone) to suggest, I might suggest it on gmod's suggestion repo

if you dont need to change gmod's binaries to do it, you can make it, and then make a PR in gmod's actual repo

Sadly I think that the entity code is all in C++ so it means its FP's work to implement.

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.