Changing Surface Skin in a 3D model????
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- edypagaza
- Posts: 78
- Joined: Mon Mar 07, 2016 12:35 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Changing Surface Skin in a 3D model????
Hi, i want to know if is possible to change the texture of a 3d model
- ramon.dexter
- Posts: 1529
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: Changing Surface Skin in a 3D model????
Yes, it is possible.
If you want more elaborate answer, specify your question.
If you want more elaborate answer, specify your question.
- edypagaza
- Posts: 78
- Joined: Mon Mar 07, 2016 12:35 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: Changing Surface Skin in a 3D model????
i mean, during gameplay with acs
after a 3d zombie dies by fire, change his texture to a black one, i dont want to spawn a new actor as burned zombie
after a 3d zombie dies by fire, change his texture to a black one, i dont want to spawn a new actor as burned zombie
- ramon.dexter
- Posts: 1529
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: Changing Surface Skin in a 3D model????
No need to involve acs at all. This could be done purely in modeldef.
So, lets say you have sprites for normal, like ZOMB A 0. Then, you have sprite for the burning death, something like ZOBD A 0. In this case you just have to define it like this in modeldef:
Basically, you have to re-define the skin before the burning frames, then define the actual frames and you're done.
So, lets say you have sprites for normal, like ZOMB A 0. Then, you have sprite for the burning death, something like ZOBD A 0. In this case you just have to define it like this in modeldef:
Code: Select all
model zombie {
//normal frames
path "models/zombie/"
model 0 "zombie.md3"
skin 0 "zombie_normal.png"
frameindex ZOMB A 0 0
//now the burning frames
skin 0 "zombie_burned.png"
frameindex ZOBD A 0 0
}
- edypagaza
- Posts: 78
- Joined: Mon Mar 07, 2016 12:35 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: Changing Surface Skin in a 3D model????
but without changing the frame, just the surface skin
Re: Changing Surface Skin in a 3D model????
Not possible. However, you might want to take a look at either Renderstyle (for pure black, use STYLE_Stencil along with black StencilColor), or a Translation that allows you to recolor the skin to give a burnt effect (my TRNSLATE entry is )
Code: Select all
Burned = "0:255=#[70,44,29]"
Last edited by Cherno on Fri Aug 27, 2021 8:13 am, edited 1 time in total.
- ramon.dexter
- Posts: 1529
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: Changing Surface Skin in a 3D model????
And how do you want to make a burned death without a frame? Sorry, but what you want is impossible.zheg wrote:but without changing the frame, just the surface skin
- edypagaza
- Posts: 78
- Joined: Mon Mar 07, 2016 12:35 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: Changing Surface Skin in a 3D model????
this is what i was looking forCherno wrote:Not possible. However, you might want to take a look at either Renderstyle (for pure black, use STYLE_Stencil along with black StencilColor), or a Translation that allows you to recolor the skin to give a burnt effect (my TRNSLATE entry is)Code: Select all
Burned = "0:255=#[70,44,29]"
i can change translation via acs
thanks
Re: Changing Surface Skin in a 3D model????
Can also be done in DECORATE/Zscript via A_SetTranslation.
- edypagaza
- Posts: 78
- Joined: Mon Mar 07, 2016 12:35 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: Changing Surface Skin in a 3D model????
this is what i done with acs and a door
Re: Changing Surface Skin in a 3D model????
I'd like to piggyback on this thread.
I have a 3D model of a computer console with a monitor. The console uses three different Surfaceskins and the monitor uses a fourth. Using an 80 Script Line I want to trigger the monitor screen to change to another texture while a warning is played. I have a script that plays my sound when the script is run. I've been able to get the screen texture to swap using MODELDEF and DECORATE as below:
(But it's not what I want)
(How can I trigger the FrameIndex from A to B in the script?)
(is there something in DECORATE "Spawn" that can be triggered instead of on a time loop?)
Model monitor1
{
Path "Models"
Model 0 "monitor1.obj"
SurfaceSkin 0 0 "blinkyra.png"
SurfaceSkin 0 1 "strim.png"
SurfaceSkin 0 2 "cpmoxl1.png"
SurfaceSkin 0 3 "popprss1.png"
Scale 1.0 1.0 1.2
USEACTORPITCH
USEACTORROLL
FrameIndex MDCA A 0 0
SurfaceSkin 0 3 "popprss2.png"
FrameIndex MDCA B 0 0
}
=======================
ACTOR monitor1 15075
{
//$Category Models
//$Title monitor1
//$Color 3
Radius 16
Height 32
Mass 20
+SOLID
+NOGRAVITY
+DONTTHRUST
+NOBLOOD
States
{
Spawn:
MDCA A 30
MDCA B 30
Loop
}}
=============================
SCRIPT 3 (VOID)
{
PlaySound (157, "CPGSLKST", CHAN_BODY, 0.25, false, ATTN_NORM, false);
}
I have a 3D model of a computer console with a monitor. The console uses three different Surfaceskins and the monitor uses a fourth. Using an 80 Script Line I want to trigger the monitor screen to change to another texture while a warning is played. I have a script that plays my sound when the script is run. I've been able to get the screen texture to swap using MODELDEF and DECORATE as below:
(But it's not what I want)
(How can I trigger the FrameIndex from A to B in the script?)
(is there something in DECORATE "Spawn" that can be triggered instead of on a time loop?)
Model monitor1
{
Path "Models"
Model 0 "monitor1.obj"
SurfaceSkin 0 0 "blinkyra.png"
SurfaceSkin 0 1 "strim.png"
SurfaceSkin 0 2 "cpmoxl1.png"
SurfaceSkin 0 3 "popprss1.png"
Scale 1.0 1.0 1.2
USEACTORPITCH
USEACTORROLL
FrameIndex MDCA A 0 0
SurfaceSkin 0 3 "popprss2.png"
FrameIndex MDCA B 0 0
}
=======================
ACTOR monitor1 15075
{
//$Category Models
//$Title monitor1
//$Color 3
Radius 16
Height 32
Mass 20
+SOLID
+NOGRAVITY
+DONTTHRUST
+NOBLOOD
States
{
Spawn:
MDCA A 30
MDCA B 30
Loop
}}
=============================
SCRIPT 3 (VOID)
{
PlaySound (157, "CPGSLKST", CHAN_BODY, 0.25, false, ATTN_NORM, false);
}
Re: Changing Surface Skin in a 3D model????
Nevermind All,
Found a thread right after I posted with a solution from Enjay. SwitchableDecoration solved my issue! Then just add Thing_Activate to the script. Changes monitor texture from one to the other.
Any one have something better?
ACTOR monitor1 : SwitchableDecoration 15075
{
//$Category Models
//$Title monitor1
//$Color 3
Radius 16
Height 32
Mass 20
+SOLID
+NOGRAVITY
+DONTTHRUST
+NOBLOOD
States
{
Spawn:
goto Inactive +1
Inactive:
MDCA A 1
MDCA B -1
Stop
Active:
MDCA A -1
MDCA B 1
Stop
}}
=======================
SCRIPT 3 (VOID)
{
PlaySound (157, "CPGSLKST", CHAN_BODY, 0.25, false, ATTN_NORM, false);
Thing_Activate (157);
}
Found a thread right after I posted with a solution from Enjay. SwitchableDecoration solved my issue! Then just add Thing_Activate to the script. Changes monitor texture from one to the other.
Any one have something better?
ACTOR monitor1 : SwitchableDecoration 15075
{
//$Category Models
//$Title monitor1
//$Color 3
Radius 16
Height 32
Mass 20
+SOLID
+NOGRAVITY
+DONTTHRUST
+NOBLOOD
States
{
Spawn:
goto Inactive +1
Inactive:
MDCA A 1
MDCA B -1
Stop
Active:
MDCA A -1
MDCA B 1
Stop
}}
=======================
SCRIPT 3 (VOID)
{
PlaySound (157, "CPGSLKST", CHAN_BODY, 0.25, false, ATTN_NORM, false);
Thing_Activate (157);
}
- ramon.dexter
- Posts: 1529
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: Changing Surface Skin in a 3D model????
Please, put the code where it belongs: into 'code' blocks...
Re: Changing Surface Skin in a 3D model????
Like this...ramon.dexter wrote:Please, put the code where it belongs: into 'code' blocks...
Code: Select all
ACTOR monitor1 : SwitchableDecoration 15075
{
//$Category Models
//$Title monitor1
//$Color 3
Radius 16
Height 32
Mass 20
+SOLID
+NOGRAVITY
+DONTTHRUST
+NOBLOOD
States
{
Spawn:
goto Inactive +1
Inactive:
MDCA A 1
MDCA B -1
Stop
Active:
MDCA A -1
MDCA B 1
Stop
}}
=======================
SCRIPT 3 (VOID)
{
PlaySound (157, "CPGSLKST", CHAN_BODY, 0.25, false, ATTN_NORM, false);
Thing_Activate (157);
}
Re: Changing Surface Skin in a 3D model????
I don't post often and only after I scour the Forum for a possible solution. After 4 hours of looking I posted, only to find Enjay's solution minutes later.
Preview of the blocked code looks like the first time I tried images. Not sure If it's right.
Code: Select all
I will block my code in the future, I had problems posting images the first time tried.