Home Unreal Engine

Creating a custom Prism node (HLSL)

polycount lvl 666
Offline / Send Message
PolyHertz polycount lvl 666
I've been trying to wrap my head around how to write a simple custom node in UDK for the last two days with no success. What I want to do is make a node that will separate the red channel from any sample run through it.

I have no experience with custom nodes in UDK, and just started learning HLSL, so please no psedo code.

Replies

  • leslievdb
    Options
    Offline / Send Message
    leslievdb polycounter lvl 15
    Set your customnode output type to CMOT_Float1
    define a name for your input and then use the code below with ofcourse the inputname changed to the one you gave
    float1(Inputname.r)
    
    is that what you mean?
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Why not just use a channel mask node?
  • PolyHertz
    Options
    Offline / Send Message
    PolyHertz polycount lvl 666
    wow...You just did what I've been trying to figure out for two days in one line...I hate you so much right now :poly121:


    fake edit:
    Actually now I'm wondering how you'd offset the channel with a second input for the texture coordinates? and is it possible to have multiple outputs on a custom node?

    Vailias: Because I want to be able to offset the channels UVs each after theyve been separated, and I don't know how to do that with the built-in nodes (I'm all ears though), plus it gives me an excuse to spend a while trying to learn the basics of hlsl.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    PolyHertz wrote: »
    Vailias: Because I want to be able to offset the channels UVs each after theyve been separated, and I don't know how to do that with the built-in nodes (I'm all ears though), plus it gives me an excuse to spend a while trying to learn the basics of hlsl.

    Why do you want to do it after separating the channels? why not just have two or three texture samples with different UV inputs?
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    yeah not sure about after, but you can make your texture sample a parameter, then duplicate it so its instanced in the shader for resource reuse, then modify the coord sample for each sample, and mask the channels you want.
    What's the end result you're wanting for your project?
Sign In or Register to comment.