Author Topic: Material Coding Help [SOLVED]  (Read 2928 times)

Offline RedWine

  • Familiar Grounds Dweller
  • **
  • Posts: 76
  • Country: 00
  • Floof-O-Meter: 7
    • View Profile
Material Coding Help [SOLVED]
« on: April 05, 2014, 10:24:08 pm »
I don't know if this is the right place to post this. I apologize if I got the wrong board.

I've been having issues trying to get the effect I want with one of my materials for a mesh I made. I'm doing a reflective shine on the eyes that works just fine, but when I try to make it transparent to see the actual eye underneath, it goes all..weird. The only thing you can see through the eye shine mesh part is the ground and the sky. I feel like it has something to do with texture layering, but I really have no idea.

Here's an image to help you see what's going on.


And here's my material.
Code: [Select]
material eyes2Mat
{
    receive_shadows off

    technique
    {
        pass eyes2Mat
        {
            ambient 0.800000011920929 0.800000011920929 0.800000011920929 0.30000001192092896
            diffuse 0.6400000190734865 0.6400000190734865 0.6400000190734865 0.30000001192092896
            specular 0.5 0.5 0.5 0.30000001192092896 12.5
            emissive 0.800000011920929 0.800000011920929 0.800000011920929 0.30000001192092896

cull_hardware none
cull_software none
scene_blend alpha_blend

            texture_unit
            {
                texture Reflection.png
                tex_address_mode wrap
                scale 1.0 1.0
                env_map planar
tex_coord_set 0
                colour_op modulate
            }
        }
    }
}
« Last Edit: April 07, 2014, 08:08:03 pm by Aria »

Offline RedWine

  • Familiar Grounds Dweller
  • **
  • Posts: 76
  • Country: 00
  • Floof-O-Meter: 7
    • View Profile
Re: Material Coding Help
« Reply #1 on: April 06, 2014, 07:11:40 am »
No body has any idea how to fix this...?

Offline Chunky_Squirrel

  • Elder Grey Pelt
  • ****
  • Posts: 2,769
  • Country: 00
  • Floof-O-Meter: 125
  • Forever Flaming
    • View Profile
Re: Material Coding Help
« Reply #2 on: April 06, 2014, 12:38:50 pm »
Hmmm... Idk if this will help, but try looking to this thread.
If nothing works, then contact a staff member for you to help. ;)

http://www.feral-heart.com/index.php?option=com_jfusion&Itemid=2&jfile=index.php&topic=30544.0

Good luck! ^.^
« Last Edit: April 06, 2014, 12:42:41 pm by TinyTail »

Profile picture by me! ^.^
IM BACK!!!

milothegolden

  • Guest
Re: Material Coding Help
« Reply #3 on: April 06, 2014, 01:37:38 pm »
maybe its a glitch in your'e soft ware or it might be the crow jaw throwing the texture off. how many charaters do u have made? if its a lot that might be throwing it off too.  ???

try asking the staff with a personal message if u cant find a soultion.  ;D

Offline Goldilocks

  • Familiar Grounds Dweller
  • **
  • Posts: 92
  • Floof-O-Meter: 20
    • View Profile
Re: Material Coding Help
« Reply #4 on: April 06, 2014, 03:56:13 pm »
I don't know if this is the right place to post this. I apologize if I got the wrong board.

I've been having issues trying to get the effect I want with one of my materials for a mesh I made. I'm doing a reflective shine on the eyes that works just fine, but when I try to make it transparent to see the actual eye underneath, it goes all..weird. The only thing you can see through the eye shine mesh part is the ground and the sky. I feel like it has something to do with texture layering, but I really have no idea.

Here's an image to help you see what's going on.


And here's my material.

Code: [Select]
material eyes2Mat
{
    receive_shadows off

    technique
    {
        pass eyes2Mat
        {
            ambient 0.800000011920929 0.800000011920929 0.800000011920929 0.30000001192092896
            diffuse 0.6400000190734865 0.6400000190734865 0.6400000190734865 0.30000001192092896
            specular 0.5 0.5 0.5 0.30000001192092896 12.5
            emissive 0.800000011920929 0.800000011920929 0.800000011920929 0.30000001192092896

cull_hardware none
cull_software none
scene_blend alpha_blend

            texture_unit
            {
                texture Reflection.png
                tex_address_mode wrap
                scale 1.0 1.0
                env_map planar
tex_coord_set 0
                colour_op modulate
            }
        }
    }
}
You didn't put the texture's name in there. Make sure it's a .png file.

Offline RedWine

  • Familiar Grounds Dweller
  • **
  • Posts: 76
  • Country: 00
  • Floof-O-Meter: 7
    • View Profile
Re: Material Coding Help
« Reply #5 on: April 07, 2014, 04:43:29 am »
NVM SOLVED
Hmmm... Idk if this will help, but try looking to this thread.
If nothing works, then contact a staff member for you to help. ;)

http://www.feral-heart.com/index.php?option=com_jfusion&Itemid=2&jfile=index.php&topic=30544.0

Good luck! ^.^
The tutorial only tells me how to make an item... I need help with the fact that the eye is going completely see through when I try to make the texture I have transparent. You can see the transparent texture on it, actually. If you look closely, it's the reflection of the sky and pine trees. I can't see the eye underneath it. The transparency code I am using is making the eye show through all the way to the land mesh and the sky. That's what I'm having issues with. I've tried a few other transparency codes, but they wouldn't make the .png texture see through like you see it now.

I'm also not trying to put two textures on one surface of the mesh, if anyone is getting confused. They are on two different spheres. The eye sphere is inside the eye shine sphere.


maybe its a glitch in your'e soft ware or it might be the crow jaw throwing the texture off. how many charaters do u have made? if its a lot that might be throwing it off too.  ???

try asking the staff with a personal message if u cant find a soultion.  ;D
I don't know if that's the issue. I'm not having problems with the texture, and I don't have too many characters (not quite sure what you meant by that though. I'm in the preset maker, not online). What I meant by texture layering was something about what layer the textures are being rendered on. I'm not a game coder and what I'm talking about might be completely wrong. Idk. I would think that it works like that.


You didn't put the texture's name in there. Make sure it's a .png file.
The texture for the eye underneath is in a separate material file.

Here's what it looks like when I make the eye shine material completely invisible:


Here's the eye shine without "scene_blend alpha_blend" in the material:



I figured out what the problem was. I had to add the code "depth_write off" in my material. Now it's working perfectly! Thanks to everyone who tried to help me. Sorry if my situation seemed really confusing... I tried my best to explain it.

Here's what it looks like now, which is what I wanted:



And here's the material for the eye reflection/shine:
Code: [Select]
material eyes2Mat
{
    receive_shadows off

    technique
    {
        pass eyes2Mat
        {
            ambient 0.800000011920929 0.800000011920929 0.800000011920929 0.30000001192092896
            diffuse 0.6400000190734865 0.6400000190734865 0.6400000190734865 0.5
            specular 0.5 0.5 0.5 0.30000001192092896 12.5
            emissive 0.800000011920929 0.800000011920929 0.800000011920929 0.30000001192092896

            scene_blend alpha_blend
            depth_write off

            texture_unit
            {
                texture Reflection.png
                tex_address_mode wrap
                scale 1.0 1.0
                env_map spherical
                tex_coord_set 0
                colour_op modulate
            }
        }
    }
}

I think maybe I should make a tutorial on how to create a reflective material for objects (or at least the illusion of it being reflective). That would be fun. : D I was trying to figure this out for days.
« Last Edit: April 07, 2014, 08:08:45 pm by Aria »