3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: iShaderFloatSet for imposters?  (Read 487 times)

fourdee

« on: December 18, 2012, 10:59:33 AM »
Hi guys & gals,

I'am trying to overcome the following issue and need some assistance:

My game relies alot of changing colours/shader settings of objects on the fly. I'am currently using imposters where possible to improve performance.
Currently, setting a shader setting on the object relays to all imposters.

My Question:
- Is there any way to set unique shader properties (eg: iShaderFloatSet(SM_TIREB,"cEmissive",2);) to an imposter?
or
- Is there some way of making the imposter an object in its own right so it can be set by iShaderFloatSet(obj_imposter) etc?

I've tried using iShaderFloatSet(SM_TIREB[0]... and (0) with no luck.

Heres my example code:
Code: [Select]
           
//Create the imposter
iObjectImpostersCreate(SM_TIREB,1);

//Set imposter loc/rot
iObjectImposterSet(SM_TIREB,0,q_bike,v3_bike);

//Set object shader
iShaderFloatSet(SM_TIREB,"cEmissive",2);

//Set unique imposter shader
iShaderFloatSet(SM_TIREB?????,"cEmissive",1);


Anyone who can shed some light on this, i would be greatful! :)
Cheers
« Reply #1 on: December 18, 2012, 11:17:23 AM »
"shed some light"... good one  :D

alas, i think that this is one of those obstacles that may be very difficult to overcome... if not impossible...

the function only works on objects that you can relay an object id to the function... i don't think that's possible with imposters...

you might look into using more than one skinmesh master, and more than one set of imposters (one for each mesh)...  align the imposters from each set to the respective one from the other and hide/show as required...



--Mike
« Last Edit: December 18, 2012, 11:20:20 AM by Mike Hense »

fourdee

« Reply #2 on: December 20, 2012, 09:30:18 PM »
"shed some light"... good one  :D

alas, i think that this is one of those obstacles that may be very difficult to overcome... if not impossible...

Mike, thanks, i think you might be right.
I think the only solution is to somehow tell 3Drad that my imposter is a unique object, which is beyond my current knowledge.

I'll keep digging. You never know, in a few years i might have the knowledge to finally find a solution and i'll post it here. lol :)
Pages: [1]