Material script use a custom texture?

Everything related to 3D programming
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Material script use a custom texture?

Post by Samuel »

When using a material script. I know that you can use EntityCustomParameter() to change the parameters that have been set with custom.
Like this one for example.

Code: Select all

param_named_auto Depth custom 1
But to me it looks like this isn't possible for a texture. At least not with that command.
Similar to how EntityCustomParameter() works. I'm hoping for a way to set the texture in Purebasic and then send that info to the material script.
Which will then update with the new information. Is this possible or can you only predefine the texture in the material script?

I can go into greater detail if needed. Thanks!
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: Material script use a custom texture?

Post by Bananenfreak »

Hmm, I think it is the only Chance to define a few materialscripts and Change materialscripts.
Image
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Material script use a custom texture?

Post by Samuel »

Creating a few material scripts would solve the issue if it was just a couple textures, but in my case there will be hundreds of texture options.
I was hoping for a solution that would allow me to have one script, but allow me to change the textures simply by adjusting a custom parameter in PB.
So, far I haven't found anything in OGRE or Purebasic. So, I think I'm about to give up on this. At least for the time being.
If someone does find a solution or has a thought on this please let me know.
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: Material script use a custom texture?

Post by Comtois »

look at ReloadMaterial.pb example. It's not the faster solution, but may be this can help ? You can change a materialScript, save it, and reload it.
Please correct my english
http://purebasic.developpez.com/
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Material script use a custom texture?

Post by Samuel »

Comtois wrote:look at ReloadMaterial.pb example. It's not the faster solution, but may be this can help ? You can change a materialScript, save it, and reload it.
Thank you Comtois,

I think that will work. I need to test it a little to make sure, but that example looks very promising.

Alexi wrote: Yes, we can change it, but not create new Scripts at runtime. :D
I can already create scripts at runtime. Just by using the standard file creation. The problem was creating a script after the archives were already parsed.
If I understood this correctly we can create a script using the file commands. Then with ReloadMaterial() we can reload the newly created script even after the scripts
were already parsed.
Post Reply