Author Topic: Anyone around who wants to do contract shader development for Unity 3D?  (Read 4410 times)

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
This is something that I need occasionally, and in particular now.

Right now the shader I need is something that will work as a regular diffuse shader with alpha blending (which I already have) PLUS which also has the following rule: "If a pixel has 1f opacity, draw it, if it has <1f opacity, do not draw it."

That's something I don't know how to code in their shader language, which really seems poorly documented.  And in an efficient low-shader-level-required way I'm really not good for that.

Any takers?  Draco18, is this up your alley?  Obviously this would be for payment, agreed in advance on an hourly basis most likely.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: Anyone around who wants to do contract shader development for Unity 3D?
« Reply #1 on: September 11, 2013, 11:21:44 am »
Haha, shaders. XD
I can't write shaders to save my life.  I can edit and tweak shaders sometimes, but that's about it.

What you're looking for is Alpha cutoff.  Unity has a default one under Transparency -> Cutoff.  I think it's a regular diffuse shader otherwise, just ramp the cutoff value all the way up.  Might have to set the value with code (i.e. to make it 0.999999f without it being 1f, which would make even full alpha pixels not draw).

If that's not what you need, I'll need some more info and some examples.  I may be able to modify an existing shader to do what you're looking for (combining two existing shaders, while tricky, is something I've accomplished).
« Last Edit: September 11, 2013, 11:23:47 am by Draco18s »

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Anyone around who wants to do contract shader development for Unity 3D?
« Reply #2 on: September 11, 2013, 11:34:33 am »
Ah!  Very nice.  Though actually, turns out I can do this with a simple alpha test, which has me slapping my head, heh. ;)
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: Anyone around who wants to do contract shader development for Unity 3D?
« Reply #3 on: September 11, 2013, 12:17:32 pm »
Ah!  Very nice.  Though actually, turns out I can do this with a simple alpha test, which has me slapping my head, heh. ;)

At least you know the difference between a shader, a texture, and a material.  Unlike my boss.
"Make it shiny, it should be wet."
*Changes shader to specular*
"Why does it look like it's made out of copper?"
Because it is shiny with a red specular color on a brown texture.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Anyone around who wants to do contract shader development for Unity 3D?
« Reply #4 on: September 11, 2013, 12:19:53 pm »
Heh.  Goodness.

Yeah, I actually have a ton of experience with textures and materials from my 3D modeling work, but coding shaders is a foreign thing to me that I've never found wonderful documentation for.

Anyway, thanks!
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: Anyone around who wants to do contract shader development for Unity 3D?
« Reply #5 on: September 11, 2013, 12:34:00 pm »
Yeah, I actually have a ton of experience with textures and materials from my 3D modeling work, but coding shaders is a foreign thing to me that I've never found wonderful documentation for.

Supposedly my boss has been 3D modeling for years.  I still have to explain to him the difference between a texture and a shader every time we build something in Unity.

As for coding them:
Exactly.  I haven't found any good reference for coding shaders either.  Which is why I can muck around inside one and tweak things, but can't write them from scratch.

What was I doing the other day..?  I needed the default Unity Bumped Specular shader (which the source for the default shaders are available online) and I was trying to add...something.  It was like "I need this shader, but with bump" and smashed it together with the default bumped specular.

OH!  I remember now, it was a "glow" shader that would put a glow around objects by essentially bluring whatever was being rendered, take that and colorize it.  Because I wanted to do a mouse-over highlight effect on an object that used the default bumped specular shader and losing the bumpmapping was going to be a No Go.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Anyone around who wants to do contract shader development for Unity 3D?
« Reply #6 on: September 11, 2013, 12:35:23 pm »
I'm the same way, although perhaps with less patience with mucking with them since it's always guess-and-check.  I don't understand why there is not some sort of consolidated language reference somewhere; I don't know where other programmers are learning this stuff.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: Anyone around who wants to do contract shader development for Unity 3D?
« Reply #7 on: September 11, 2013, 12:47:30 pm »
I'm the same way, although perhaps with less patience with mucking with them since it's always guess-and-check.  I don't understand why there is not some sort of consolidated language reference somewhere; I don't know where other programmers are learning this stuff.

It's because vertex shaders are run on the GPU.
https://developer.nvidia.com/cg-toolkit <-- best resource I can find for doing that....

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Anyone around who wants to do contract shader development for Unity 3D?
« Reply #8 on: September 11, 2013, 12:49:07 pm »
Sure, but what processor it runs on has nothing to do with whether or not there can be a reference.  Still, there are a few things but there are no real guides to how to do stuff.  And most of this is abstracted through either unity in this case, or through directx or opengl under that.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Anyone around who wants to do contract shader development for Unity 3D?
« Reply #9 on: September 11, 2013, 01:15:09 pm »
I don't know where other programmers are learning this stuff.
I think you have to make certain inscriptions on your front door, and then on the next full moon the shader fairies whisk you away to the land of shadow programming for what feels like 3 months in the space of an hour.

Something like that.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Anyone around who wants to do contract shader development for Unity 3D?
« Reply #10 on: September 11, 2013, 01:27:07 pm »
That sounds about right.  Or at best shaders to be an oral tradition. ;)
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline orzelek

  • Hero Member Mark III
  • *****
  • Posts: 1,096
Re: Anyone around who wants to do contract shader development for Unity 3D?
« Reply #11 on: September 11, 2013, 01:38:13 pm »
I read quite a lot about them in latest OpenGL guide.
I would need to check for the exact title tho.

Sadly my knowledge is only from reading.. don't have occasions to use them yet.
And some of maths there would require me to refresh my knowledge about few topics.

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: Anyone around who wants to do contract shader development for Unity 3D?
« Reply #12 on: September 11, 2013, 01:48:22 pm »
I don't know where other programmers are learning this stuff.
I think you have to make certain inscriptions on your front door, and then on the next full moon the shader fairies whisk you away to the land of shadow programming for what feels like 3 months in the space of an hour.

Something like that.[/quote]

Too bad Enochian is a lost language.