Feral Heart

Help & Guidance => Game Help => Topic started by: cafren on September 08, 2017, 11:26:25 pm

Title: Is it possible to keep the main layer trans with a scroll? Preset Issues[Solved]
Post by: cafren on September 08, 2017, 11:26:25 pm
Hey, I have a quick question here.


I'm working on a preset and I want to make the main layer transparent like this:


(https://i.imgur.com/ESCJpKD.png)

But, I want certain parts to scroll. I've done the code, but I got this:


(https://i.imgur.com/LVdduou.png)

I don't want to be able to see it scrolling behind the trans layer, just the parts I cut out.

Is there anyway to fix this? Here's the code I used preset_3head.png is the trans-layer and  preset_3headI is the scrolling layer:


material preset_3_headMatL
{
 technique
 {
  pass
  {
   texture_unit
   {
    texture preset_3headI.png
    scroll_anim 1.0 1.0
   }
  }
  pass
  {
   depth_check on
   depth_write off
   scene_blend alpha_blend
   texture_unit
   {
    texture preset_3head.png
   }
  }
 }
}
Title: Re: Is it possible to keep the main layer trans with a scroll? Preset Issues
Post by: Hakumi on September 09, 2017, 12:39:51 am
So what you're wondering is...

1. Is there a way to keep the transparency while there's a definite scrolling animation where it's cut off at? ( While not being able to see the scrolling where you want it to be transparent ).

2. And if so, what's the coding for it?
Title: Re: Is it possible to keep the main layer trans with a scroll? Preset Issues
Post by: cafren on September 09, 2017, 12:47:06 am
So what you're wondering is...

1. Is there a way to keep the transparency while there's a definite scrolling animation where it's cut off at? ( While not being able to see the scrolling where you want it to be transparent ).

2. And if so, what's the coding for it?

Yes to both.

I'm playing around with the code but it's either the picture I posted or it's completely white sadly.

Title: Re: Is it possible to keep the main layer trans with a scroll? Preset Issues
Post by: Lucius on September 09, 2017, 12:56:14 am
It's possible, let me get my code in order and I'll show you how.

Alright, so first we have a transparent head.

Then, we overlay a mask to let us know where we want the scrolling texture.

And finally, we have the scrolling texture.

The code to make this work is this:
Code: [Select]
material preset_12_headMatL
 {
    technique
    {
       pass
       {
scene_blend alpha_blend
alpha_rejection greater 128
texture_unit
{
texture TRANSPARENT HEAD.png
}
}
pass
{
scene_blend alpha_blend
alpha_rejection greater 128
texture_unit
{
texture HEAD MASK (BLACK AREAS WHERE YOU WANT SCROLLING).png
}
texture_unit
{
texture HEAD MASK (BLACK AREAS WHERE YOU WANT SCROLLING).png             
colour_op alpha_blend
}
texture_unit
{
texture SCROLLING TEXTURE.jpg
colour_op_ex blend_current_alpha src_texture src_current
tex_address_mode wrap
filtering trilinear
scroll_anim 0.0 0.1
          }
       }
    }
 }

The result is this:
Title: Re: Is it possible to keep the main layer trans with a scroll? Preset Issues
Post by: cafren on September 09, 2017, 01:13:32 am
Omg, thank you so much!!!

It works now! (❁´▽`❁)*✲゚*

Thank you both for replaying! (●⌒∇⌒●)