2 registered members (7th_zorro, dr_panther),
724
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
ent_decal issue
#339579
08/27/10 21:02
08/27/10 21:02
|
Joined: Jul 2009
Posts: 96
mEnTaL
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2009
Posts: 96
|
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:
......
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 : )
|
|
|
Re: ent_decal issue
[Re: mEnTaL]
#339580
08/27/10 21:08
08/27/10 21:08
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
What problems does scan_texture cause? Because it REQUIRED to ent_decal to work.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: ent_decal issue
[Re: EvilSOB]
#339581
08/27/10 21:19
08/27/10 21:19
|
Joined: Jul 2009
Posts: 96
mEnTaL
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2009
Posts: 96
|
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 ?
|
|
|
Re: ent_decal issue
[Re: mEnTaL]
#339585
08/27/10 21:54
08/27/10 21:54
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
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...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: ent_decal issue
[Re: EvilSOB]
#339587
08/27/10 22:00
08/27/10 22:00
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I just found this in the manual under ent_decal 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...
...
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; }
Last edited by EvilSOB; 08/27/10 22:05.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: ent_decal issue
[Re: mEnTaL]
#339598
08/27/10 23:05
08/27/10 23:05
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
So which one was it? The materials need setting (as in my last post)?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: ent_decal issue
[Re: mEnTaL]
#339607
08/28/10 00:36
08/28/10 00:36
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
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?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|