Author Topic: Semi-transparent Preset for Summerparty  (Read 1806 times)

Offline Ellen11v

  • Don't open, blue inside
  • Elder Grey Pelt
  • ****
  • Posts: 3,047
  • Country: dk
  • Floof-O-Meter: 276
  • Bye :)
    • Lousiem
    • EllenPlayz
    • View Profile
    • Global Moderator of an IT server
Semi-transparent Preset for Summerparty
« on: July 14, 2018, 12:00:07 pm »
Hellu floofs~
I have this problem with semi-transparency in preset making, where I'm questioning:
How come the solid part/marking of the semi-transparent head is see-through-able? (You can see the teeth, tongue, and other body parts. It's very annoying!)

I'll show you pictures of what the preset looks like in-game and in GIMP.
I'll also leak the code that I used bellow. If there are any professionals out there, I would highly appreciate it if you would let me know what's gone wrong here. I hope I can get answers before the 19th July (5 days), because that's the deadline for sending in presets to the Summer Party. ;w;

In-game:



How it's done in GIMP (IMAGE HEAVY):

Semi-transparency code that I used from Ruby's tutorial
(except I made the eye parts default, because otherwise it would be unnoticeably white for some reason, and I prevented that by making them default. You can look in the code and see what I mean by default.):

Code: [Select]
material preset_3_bodyMatL
{
 technique
 {
  pass
  {
   depth_check on
   depth_write off
   scene_blend alpha_blend
   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_3body.png
   }
  }
 }
}
material preset_3_headMatL
{
 technique
 {
  pass
  {
   depth_check on
   depth_write off
   scene_blend alpha_blend
   texture_unit
   {
    texture preset_3head.png
   }
  }
 }
}
material preset_3_headMatR
{
 technique
 {
  pass
  {
   depth_check on
   depth_write off
   scene_blend alpha_blend
   texture_unit
   {
    texture preset_3head.png
   }
  }
 }
}
material preset_3_eyeMatL
{
 technique
 {
  pass
  {
   cull_hardware none
   cull_software none
   texture_unit
   {
    texture preset_3eye.png
   }
  }
 }
}
material preset_3_eyeMatR
{
 technique
 {
  pass
  {
   cull_hardware none
   cull_software none
   texture_unit
   {
    texture preset_3eye.png
   }
  }
 }
}
material preset_3_tailMat
{
 technique
 {
  pass
  {
   depth_check on
   depth_write off
   scene_blend alpha_blend
   texture_unit
   {
    texture preset_3tail.png
   }
  }
 }
}
material preset_3_maneMat
{
 technique
 {
  pass
  {
   cull_hardware none
   cull_software none
   depth_check on
   depth_write off
   scene_blend alpha_blend
   texture_unit
   {
    texture preset_3mane.png
   }
  }
 }
}

Thanks in advance!
« Last Edit: July 14, 2018, 12:06:33 pm by Ellen11v »
doing what i feel like

Lucius

  • Guest
Re: Semi-transparent Preset for Summerparty
« Reply #1 on: July 14, 2018, 05:29:19 pm »
Remove the "depth_check on" and "depth_write off" lines from the coding.

The depth_check attribute is already on by default, so there's no need to reiterate it. The main culprit is the depth_write attribute, which you have set to off. By default, it is on and should stay on unless you are rendering static backgrounds.

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 depth check is basically what allows objects rendered behind other solid objects to be hidden by them. If depth checking is off, pixels are written no matter what has been rendered before. In your case, the "depth_write off" was interfering with the depth checking and causing the body parts behind other solid body parts to show up. If you look at the tail in your .GIF, it's doing the same thing, despite the fact that you don't have a texture on it.

Offline Ellen11v

  • Don't open, blue inside
  • Elder Grey Pelt
  • ****
  • Posts: 3,047
  • Country: dk
  • Floof-O-Meter: 276
  • Bye :)
    • Lousiem
    • EllenPlayz
    • View Profile
    • Global Moderator of an IT server
Re: Semi-transparent Preset for Summerparty
« Reply #2 on: July 15, 2018, 08:42:17 am »
Stay cool Ellen... Stay cool... *deep breath*
Ahem yes very nice, ehm...
Thank you
Thank you
Thank you
Thank you
Thank you
Thank you
Thank you
Thank you
You have no idea how much I love you you're a genius thank you
THANK YOU...
... (yes the problem solved)

I can't find words for how good you are at explaining things Lucius. I think there's a good reason that your patronus is an unicorn (yes I have read your bio before), because you sure save people's butt like one. You're a bright light in the dark. I can't appreciate you enough for this help. <3
*furiously clicks the nuzzle button*
« Last Edit: July 15, 2018, 08:45:34 am by Ellen11v »
doing what i feel like

Lucius

  • Guest
Re: Semi-transparent Preset for Summerparty
« Reply #3 on: July 15, 2018, 12:14:47 pm »
Thank you so much for the kind words Ellen, you have no idea how nice it was to wake up to this post. I am very glad that this solved your problem c:

Good luck on your preset, I'm sure it will look splendid.

Offline Kerriki

  • Band Geek
  • Immortal Legend
  • *****
  • Posts: 5,670
  • Country: us
  • Floof-O-Meter: 371
  • Who needs furniture when you have the floor?
    • Kikiorylandia
    • View Profile
    • DeviantART
Re: Semi-transparent Preset for Summerparty
« Reply #4 on: July 15, 2018, 06:11:27 pm »
Locking this up, looking forward to receiving your preset soon c:
Farewell everyone<3