Author Topic: Is it possible to keep the main layer trans with a scroll? Preset Issues[Solved]  (Read 1411 times)

Offline cafren

  • Curious Wanderer
  • *
  • Posts: 38
  • Country: us
  • Floof-O-Meter: 5
  • Younder ?
    • View Profile
    • DeviantArt
Hey, I have a quick question here.


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




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




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
   }
  }
 }
}
« Last Edit: September 09, 2017, 01:13:48 am by cafren »

Offline Hakumi

  • ✩ Just A Virtuous Smol ✩
  • Honored Hero
  • *****
  • Posts: 4,835
  • Country: 00
  • Floof-O-Meter: 130
  • A Smol & Helpful Floof ~
    • leanim3fr3akzoid
    • LeAnim3Fr3akzoid
    • View Profile
Re: Is it possible to keep the main layer trans with a scroll? Preset Issues
« Reply #1 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?

Keep on traveling across this road called 'Life.'

Discord: Haku - Haku#74O7

Offline cafren

  • Curious Wanderer
  • *
  • Posts: 38
  • Country: us
  • Floof-O-Meter: 5
  • Younder ?
    • View Profile
    • DeviantArt
Re: Is it possible to keep the main layer trans with a scroll? Preset Issues
« Reply #2 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.


Lucius

  • Guest
Re: Is it possible to keep the main layer trans with a scroll? Preset Issues
« Reply #3 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:
« Last Edit: July 19, 2020, 10:07:03 pm by Lucius »

Offline cafren

  • Curious Wanderer
  • *
  • Posts: 38
  • Country: us
  • Floof-O-Meter: 5
  • Younder ?
    • View Profile
    • DeviantArt
Re: Is it possible to keep the main layer trans with a scroll? Preset Issues
« Reply #4 on: September 09, 2017, 01:13:32 am »
Omg, thank you so much!!!

It works now! (´`)**

Thank you both for replaying! ()