Jump to content

Search the Community

Showing results for tags 'attributes'.

  • 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. What are all the babylon possible shader attributes and uniforms: // Attributes attribute vec3 position; attribute vec3 normal; attribute vec2 uv; // Uniforms uniform mat4 worldViewProjection; i assume they will all be equiv to some webgl attribute (if you had to do in strait webgl). So i assume: position = gl_Vertex -> To vec3 normal = gl_Normal -> To vec3 uv = gl_MultiTexCoord0 - To vec2 and worldViewProjection = gl_ProjectionMatrix * gl_ModelViewMatrix and so on... What are all the other possible attributes and uniforms, and most importantly what do they equal in regular GLSL. A... I just would to really understand where each attribute and uniform comes from. B... I am trying to make a 'Universal Unity Babylon GLSL Shader Template' for use directly in the Unity for creating Babylon shaders. Minimal Example Shader For Unity: Shader "BabylonJS/Sample basic shader" { // defines the name of the shader SubShader { // Unity chooses the subshader that fits the GPU best Pass { // some shaders require multiple passes GLSLPROGRAM // here begins the part in Unity's GLSL #ifdef VERTEX // here begins the vertex shader void main() // all vertex shaders define a main() function { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; // this line transforms the predefined attribute // gl_Vertex of type vec4 with the predefined // uniform gl_ModelViewProjectionMatrix of type mat4 // and stores the result in the predefined output // variable gl_Position of type vec4. } #endif // here ends the definition of the vertex shader #ifdef FRAGMENT // here begins the fragment shader void main() // all fragment shaders define a main() function { gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); // this fragment shader just sets the output color // to opaque red (red = 1.0, green = 0.0, blue = 0.0, // alpha = 1.0) } #endif // here ends the definition of the fragment shader ENDGLSL // here ends the part in GLSL } } } My intent was to parse the shader text blocks for the vertex and fragment sections during export. Then do some kind 'key text replace' in the vertex part that reads all the attributes and uniforms replace with babylon.js equivalent at export. I would also love to base64 encode this vertex and fragment program right in the ShaderMaterial section of the .babylon son file. I posted a topic on this, hopefully others can see the benefits as well. Anyways... Any info on all the BUILT-IN attributes and uniforms that babylon.js exposes (and how they are calculated so i can duplicate that calculation when running in unity editor) THANK YOU VERY MUCH
×
×
  • Create New...