Author Topic: Preset Problem  (Read 1111 times)

Offline OceanWaves

  • Familiar Grounds Dweller
  • **
  • Posts: 66
  • Country: us
  • Floof-O-Meter: 0
  • Avatar by me!
    • View Profile
Preset Problem
« on: September 30, 2018, 06:16:09 pm »
I just finished making a preset and there's an issue. This preset has scrolling, transparency, and semi-transparency. I've never encountered a problem like this before while making a preset. I loaded my preset in the preset creator and it looked exactly how I wanted it to. I then exported it and put the preset onto my character that I use in-game. Then, I noticed something. Half of the presets body looked like what I made while the other half is just scrolling. I deleted the export and examined my code but nothing seemed to be wrong about it.

This is in the preset maker and it shows what the preset is supposed to look like


This is the preset in the character creator

(Sorry the scrolling is so dark and hard to see)

And this is the code for the body
Code: [Select]
material preset_3_bodyMatL
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
texture preset_3scroll.png
scroll_anim 1.0 1.0
}
}
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
alpha_rejection greater_equal 128
texture_unit
{
texture preset_3body.png
}
}
}
}
material preset_3_bodyMatR
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
texture preset_3scroll.png
scroll_anim 1.0 1.0
}
}
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
alpha_rejection greater_equal 128
texture_unit
{
texture preset_3body.png
}
}
}
}
The body has both semi-transparency and scrolling but that doesn't seem to be causing the problem because only half of the preset isn't working. I really hope this is something that can be solved.
Panic! at the Disco trash #1

Flurr

  • Guest
Re: Preset Problem
« Reply #1 on: September 30, 2018, 06:37:39 pm »
Hi there! It seems like to me you could be having a problem with your scrolling code. If this is the case, add this to where you want your scrolling to go in the material code. If you want to put it on the head and body, you would erase where you want the scroll to go.
Then, add this code under the file name in the material code.

Quote
ambient 1.000000 1.000000 1.000000 1.000000
diffuse 1.000000 1.000000 1.000000 1.000000
specular 0.050000 0.050000 0.050000 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000

Hope it helps! Tell me if this was not the issue, and we will try our best to sort it out!

Lucius

  • Guest
Re: Preset Problem
« Reply #2 on: September 30, 2018, 06:43:39 pm »
Is the "depth_write off" attribute a necessary part of your preset code? Normally that's what causes issues with layered textures and objects showing up when they should be hidden behind something else.

If depth writing is off, pixels are written to the frame without updating the depth buffer. The problem is that this means the depth checking function becomes useless, even if set to on, because the depth buffer is not updated. The pixels of the pass with depth checking set to off are written no matter what has been rendered before.

My suggestion would be to remove the "depth_check on" and "depth_write off" lines from the code (the depth_check attribute is already on by default) and see if that works.

Offline OceanWaves

  • Familiar Grounds Dweller
  • **
  • Posts: 66
  • Country: us
  • Floof-O-Meter: 0
  • Avatar by me!
    • View Profile
Re: Preset Problem
« Reply #3 on: September 30, 2018, 06:54:14 pm »
Hi there! It seems like to me you could be having a problem with your scrolling code. If this is the case, add this to where you want your scrolling to go in the material code. If you want to put it on the head and body, you would erase where you want the scroll to go.
Then, add this code under the file name in the material code.

Quote
ambient 1.000000 1.000000 1.000000 1.000000
diffuse 1.000000 1.000000 1.000000 1.000000
specular 0.050000 0.050000 0.050000 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000

Hope it helps! Tell me if this was not the issue, and we will try our best to sort it out!
Hello! I put the code in the material file and the preset looks like it should! I think that was the problem. I always end up forgetting something important when I make a preset :p Thanks for your help!
Panic! at the Disco trash #1

Offline OceanWaves

  • Familiar Grounds Dweller
  • **
  • Posts: 66
  • Country: us
  • Floof-O-Meter: 0
  • Avatar by me!
    • View Profile
Re: Preset Problem
« Reply #4 on: September 30, 2018, 06:56:42 pm »
Is the "depth_write off" attribute a necessary part of your preset code? Normally that's what causes issues with layered textures and objects showing up when they should be hidden behind something else.

If depth writing is off, pixels are written to the frame without updating the depth buffer. The problem is that this means the depth checking function becomes useless, even if set to on, because the depth buffer is not updated. The pixels of the pass with depth checking set to off are written no matter what has been rendered before.

My suggestion would be to remove the "depth_check on" and "depth_write off" lines from the code (the depth_check attribute is already on by default) and see if that works.
I guess it wasn't necessary. I got rid of it and scrolling doesn't show through the entire body no matter what's in front of it now. Thank you!
Panic! at the Disco trash #1