Jump to content

Search the Community

Showing results for tags 'shader sampler2D'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Sometimes the shader I am creating will be given an image file to use as a texture sampler and sometimes it will not. In the shader when the image file is given I need the line uniform sampler2D refTexture;and in the main function a line along the lines of float x = 0.5 * texture2D(refSampler, uv).rgb.x;and when no image file is given then float x = 0.5 * position.xFrom looking at the code in the samplers in the materialsLibrary I see there are some conditions on the uniforms such as #if defined(SPOTLIGHT0) || defined(DIRLIGHT0)varying vec4 vPositionFromLight0;uniform sampler2D shadowSampler0;#elseuniform samplerCube shadowSampler0;#endif1. Is there a condition I can use for #if ..................uniform sampler2D refTexture;#endif2. Is there a conditional statement within the main function I can use for IF texture loaded float x = 0.5 * texture2D(refSampler, uv).rgb.x;ELSE float x = 0.5 * position.xENDIF
×
×
  • Create New...