Announcement

Collapse
No announcement yet.

HUD material drawing black? <Resolved>

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HUD material drawing black? <Resolved>

    I have a material that I am attempting to draw on the HUD and so far it has only shown as a black box in the dimensions I want it.

    Here's the relevant code:
    Code:
    function DrawSynchronizer()
    {
    	Canvas.SetPos(0.0, Canvas.ClipY * 0.8);
    	Canvas.DrawMaterialTile(Mat_EQ_Back, Canvas.ClipX / 3, Canvas.ClipY / 4,0,0,1,1);
    }
    defaultproperties
    {
    	Mat_EQ_Back=Material'DR_UI_Elements.Materials.HUD_EQ_Mat'
    }
    At first I thought maybe it was an unresolved reference but the compile gives me no warnings about this.

    Is there a material issue or is my syntax just wrong?

    _________________________________________________

    My syntax is fine!

    However it seems that you must tie the texture sample to the emissive channel as well or you get nothing but black.

    #2
    Hi.

    I know its quite an old thread, but I have the same problem.
    Could you solve it and if so how? Or does anyone else have an idea?

    I believe it has to do with the MaterialInterface parameter (first parameter for Draw[Rotated]MaterialTile). I have searched through epics code and found they only use it with MaterialInstanceConstants. I have not tested if that makes a difference, but will do asap.

    Thank you.

    Comment


      #3
      I still had a subscription to this old thread, as you can see though the way I fixed it was:

      Originally posted by unusualbob View Post
      My syntax is fine!

      However it seems that you must tie the texture sample to the emissive channel as well or you get nothing but black.

      Comment


        #4
        Oh, okay I thought that was your sig, so skipped it ...
        My bad, thank you.

        Is there a way to force materials to recompile AT RUNTIME? I don't think there is...?

        Comment


          #5
          What do you mean by compile? From what I understand materials themselves are more like instructions than objects, they are effectively read at runtime. You can alter materials at any point in your game using parameters in code if that's the kind of thing you are asking about.

          Comment


            #6
            Materials are indeed compiled into hardware shaders by the editor whenever you modify them. The UnrealEngine only has limited support for runtime changes, and those are only available via MaterialInstances. In other words, you cannot make structural changes.

            Comment

            Working...
            X