ent_decal issue

Posted By: mEnTaL

ent_decal issue - 08/27/10 21:02

Hi, it's me with my ent_decal problems again.
So, basicly what I am trying to do is a bullet which simply makes a hole when it hits a wall. And I did it this way:

Code:
......
VECTOR trace_target;
vec_set(trace_target,vector(50,0,0)); 	
vec_rotate(trace_target, me.pan);
vec_add(trace_target, me.x);
c_trace(me.x,trace_target, IGNORE_PASSABLE | USE_POLYGON | SCAN_TEXTURE );
PARTICLE* hole = ent_decal(you,bullethole,10,random(360));  
.......


But the SCAN_TEXTURE flag causes me a lot of problems and when I remove it the decal doesn't appear : ( . So, can you tell me how to do the same thing but without using this flag.
Thx : )
Posted By: EvilSOB

Re: ent_decal issue - 08/27/10 21:08

What problems does scan_texture cause? Because it REQUIRED to ent_decal to work.
Posted By: mEnTaL

Re: ent_decal issue - 08/27/10 21:19

When I use SCAN_TEXTURE the decal somehow takes the material from the model.
This is how the decal Should look:


And this is what happens when it is put on a terrain with Multi-texture shader:


It has some kind of a black-white square frame. When the decal is on a Non-material entity this problem doesn't exist. Any ideas ?
Posted By: EvilSOB

Re: ent_decal issue - 08/27/10 21:54

Hmmm, it appears the shader is trying to multi-testure the decals...

Try changing your decals to be 32-bit TGA rather than BMP's.
OR
Try setting the decals TRANSLUCENT flag on. "set(hole, TRANSLUCENT);"
You may need to set its alpha up to 100 too.
OR
You may need to do both TGA and TRANSLUCENT...

If this doesnt help, I would take this issue to the SHADERS forum...
Posted By: EvilSOB

Re: ent_decal issue - 08/27/10 22:00

I just found this in the manual under ent_decal
Quote:

Decals are rendered with the entity or block material and shader unless they have an own material. The decal texture can be accessed through entSkin1 in a shader. If the shader is not suited for a decal - f.i. when entSkin1 is used for a color mask on a multitexture shader, or when the alpha channel is not used for transparency - assign a decal material without a shader, such as mat_model or mat_terrain dependent on which object the decal is attached to.



So CODEWISE, I would try this...
Code:
...
c_trace(me.x,trace_target, IGNORE_PASSABLE | USE_POLYGON | SCAN_TEXTURE );
PARTICLE* hole = ent_decal(you,bullethole,10,random(360));  
if(hit.texname)   {   hole.material = mat_model;   }
else              {   hole.material = mat_terrain;   }


Posted By: mEnTaL

Re: ent_decal issue - 08/27/10 22:18

Great laugh



Thanks, man
Posted By: EvilSOB

Re: ent_decal issue - 08/27/10 23:05

So which one was it? The materials need setting (as in my last post)?
Posted By: mEnTaL

Re: ent_decal issue - 08/27/10 23:53

Yes - it is because the decal needs an own material, otherwise it extracts the material settings from the model it is put on (I think this is pretty useless 3dgs feature...)
Posted By: EvilSOB

Re: ent_decal issue - 08/28/10 00:36

No, its necessary to my mine.

1> you have a shader that applies a lighting effect. decals inherit the light level.

2> model has a shader thet deforms its surface, decals will inherit the change.

See what I mean?
Posted By: mEnTaL

Re: ent_decal issue - 08/28/10 10:48

Yes, actualy it is needed for some purposes, but if you don't know about this little detail it can break your nerves.
© 2024 lite-C Forums