About Store Forum Documentation Contact
Donations:
345$/mo



Post Reply 
MaterialPtr problem.
Author Message
b1s Offline
Member

Post: #1
MaterialPtr problem.
We are having some difficulties using the new Ptr system..

How should one change for instance .glow of a material
if setMaterial() takes only MaterialPtr and ptr does not have glow?
Can i somehow convert material to materialPtr or whatta hell.. sry I'm a bit confused about this.
10-04-2010 10:20 AM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #2
RE: MaterialPtr problem.
and on an unrelated note:

after doing all the updates and overriding this material changing problem I have ended up with an error after building on shader creation.
Code:
---------------------------
Error
---------------------------
Error loading ShaderTech "FontH" in Shader "".
---------------------------
OK  
---------------------------
10-04-2010 11:51 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: MaterialPtr problem.
for the second problem you havent updated engine.pak

what do you mean ptr does not have glow?
glow is only Flt parameter

please paste some code
10-04-2010 04:42 PM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #4
RE: MaterialPtr problem.
Well here is an example.
Im changing the glow value of a material and before the cache update i could just assign it to a meshpart. But now im not sure how to do this because setMaterial() only recives MaterialPtr
Code:
Material glowMat;
tempmesh.part(0).setMaterial(glowMat);
(This post was last modified: 10-05-2010 07:30 AM by b1s.)
10-05-2010 07:25 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: MaterialPtr problem.
where do you call this?

please read the comments for MeshPart::setMaterial method

if during drawing then you should use MaterialLock (better performance),
how to use it please check codes for Game::Item, Static, .. in source codes for licensed developers.

you can use
Material glowMat;
tempmesh.part(0).setMaterial(&glowMat); // here add &
but glowMat must be allocated in constant memory address, and be available in that memory as long as current frame finishes drawing
again please check comments on setMaterial method
10-05-2010 01:31 PM
Find all posts by this user Quote this message in a reply
Post Reply