Best way to implement light materials?

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
white_waluigi
Goblin
Posts: 253
Joined: Sat Sep 28, 2013 3:46 pm
x 10

Best way to implement light materials?

Post by white_waluigi »

I'm currently planning on implementing a light material system, in which Datablocks are used to customise lights for forwarded as well as deferred materials (Things like Gobo lights,custom toon shading, etc.. ) by allowing the users to create custom variables and insert cfusotm shader code. The only problem currently is, that ogre has no real way to assign datablocks or custom data (aside from user any, which seams to be more for the end user of ogre rather than HLMS). So I was wondering if there is a clean way to assign datablocks or at least param vecs to Ogre Lights to allow the user more customisation in that regard.
I know that there probably isn't, but I just wanted to make sure that there wasn't something like that planned before I started abusing user any.
hyyou
Gremlin
Posts: 173
Joined: Wed Feb 03, 2016 2:24 am
x 17
Contact:

Re: Best way to implement light materials?

Post by hyyou »

I faintly remember that I can set some "custom" parameter to light in Ogre 2.1 on some unused variables in spotlight attribute, color, or intensity

It works.
These are a bit hacky, but I believe it is OK as far as I know what I am doing,
e.g. beware that some parameters are used in Forward3D's pyramid-cullling.
This hack must also be handled by user's custom HLMS implementation.

I agree that the feature (to enable passing light's custom parameter to HLMS shader) would be useful.
I don't need it now, though.
Post Reply