using mCustomParameter

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
Nickak2003
Gremlin
Posts: 192
Joined: Thu Jun 10, 2004 4:19 am
x 11
Contact:

using mCustomParameter

Post by Nickak2003 »

I would like to use mCustomParameter on a per object basis. Each object is going to have a different blend value in the shader based on this parameter. From what I can figure, I need to upload to a const buffer, all objects' mCustomParameters and use drawId. I guess this is done in, hlms::fillBuffersFor ??

Help appreciated!
Last edited by Nickak2003 on Sat Aug 01, 2020 2:22 pm, edited 1 time in total.

Nickak2003
Gremlin
Posts: 192
Joined: Thu Jun 10, 2004 4:19 am
x 11
Contact:

using mCustomParameter

Post by Nickak2003 »

OK this is what I want to do:
Create a custom HLMS which inherits from PBS.

override fillbuffers for and do all the PBS stuff, but then append some stuff to pass a buffer for my per-item custom parameter. need some help
Last edited by Nickak2003 on Sat Aug 01, 2020 2:23 pm, edited 2 times in total.

Nickak2003
Gremlin
Posts: 192
Joined: Thu Jun 10, 2004 4:19 am
x 11
Contact:

using mCustomParameter

Post by Nickak2003 »

never mind, i got it working
Last edited by Nickak2003 on Sat Aug 01, 2020 2:22 pm, edited 1 time in total.

Nickak2003
Gremlin
Posts: 192
Joined: Thu Jun 10, 2004 4:19 am
x 11
Contact:

using mCustomParameter

Post by Nickak2003 »

So what I did was change mCustomParameter to a float and then access it in the pixel shader on a per-item basis. This involves editing ogre source a little.

Here's the info:
https://spotcpp.com/adding-custom-param ... for-items/

I did this so i could fade in or out individual pieces of grass rather than pop them.

Post Reply