• Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by NasimiAsl

  1. Samples for CustomMaterial

    hi i start write some documentation here for custom material ( its realy easy for me to make it here but i can move it in documentation after that complete ) definition : Custom Material inherited from stable version of Standard material (a carbon Copy of BABYLON.StandarMaterial) when we need CustomMaterial ? : any time you wanna make any custom option but you can't manage that in standard material . vertex shader definitions : position(readonly) or positionUpdated(vec3) : local position per vertex normal(readonly) or NormalUpdated(vec3) : local normal fragment shader definitions : vPositionW( readonly) : world position per pixel vNormalW(read only) vDiffuseUV(vec2) : (readonly) : defined uv attribute append when you have DiffuseTexture diffuseColor(vec3) you can manage that with Fragment_Custom_Diffuse : for control Diffuse color **** that mixed with diffuseTexture if you add any texture alpha(float) you can manage that from Fragment_Custom_alpha : for control transparency color(vec4) last result after attached all effect (light fog shadow ... ) you can manage that in Fragment_before_FragColor methods : Start .material = new BABYLON.CustomMaterial("name",scene); Demo : You can define customMaterial exactly like StandardMaterial and you have all property and methods in custom material too AddUniform material.AddUniform('test1','vec3'); simple (float,vec2, vec3,vec4,...) demo sampler without UV with Define UV array array3 , float Fragment_Begin material.Fragment_Begin( string) #include<__decl__defaultFragment> [Fragment_Begin] #extension GL_OES_standard_derivatives : enable for define any new extension or include any shader (not find any requirement for make sample) Fragment_Definitions material.Fragment_Definitions( string) #[Fragment_Definitions] void main(void) { this define before main you can define any varying or global function before main demo : make varying for simple noise used vertex data to add normal demo : change vertex use definition function Fragment_MainBegin void main(void) { vNormalW = vNormalW_helper; #[Fragment_MainBegin] demo : correct normal for back face Fragment_Custom_Diffuse you most find your result red and green and blue (witch any way you like ) and set it in diffuseColor or result *** result (vec3) in this method replaced (one time) by diffuseColor set texture setTexture use diffuseColor Fragment_Custom_Alpha you most find your alpha and set it to alpha variable or in result *** result (vec3) in this method replaced (one time) byalpha demo manage transparency Fragment_Before_FragColor before the last result you have chance to manage your result your final color available in color variable and you most be set it color after your changes *** result (vec4) in this method replaced (one time) by color demo result with and without light effect Vertex_Begin for define any new extension or include any shader (not find any requirement for make sample) Vertex_Definitions this define before main you can define any varying or global function before main Vertex_MainBegin same as Fragment_Main Vertex_Before_PositionUpdated localPosition = positionUpdated; #[Vertex_Before_PositionUpdated] gl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0); you most change positionUpdated in here for change last vertex result Vertex_Before_NormalUpdated #ifdef NORMAL #[Vertex_Before_NormalUpdated] localNormal = normalUpdated; vNormalW_helper=normalize(vec3(finalWorld*vec4(normalUpdated,0.0))); you most change normalUpdated in here for change last vertex normal result related samples Update Uniform demo
  2. More than 4 lights?

    sure final specular is a little heavy
  3. More than 4 lights?

    this sample have 256(16*16) light on one salon
  4. More than 4 lights?

    if you have salon or Regular successive lights i think you can make ultimate lights ( no shadow ) for your material
  5. Custom PBR material that is Simple PBR From CustomShader u can make any channel for you pbr ** reflectPart = function( sampler Ref, nrm , scale , RefractiveParameter , direction x , direction y , direction z , bias) part1 : new SB() .Map({path:''}) .InLine( reflectPart( 'txtRef_0','nrm' ,0.005 ,-1,-1.,-1.,-1.,0.)) .BuildMaterial(scene); you can use shader string for manage any parameter reflective mix normal mix play anything you want and ask me if you have any question about this
  6. A way to create road on ground

    correct link is but i don't understand correctly this question r u wanna make road geometry or wanna paint road on ground?
  7. Virtual fashion show

    wonderful she send some kiss too
  8. hi @vishnu welcome to BJS Area
  9. Custom texture mipmaps for roughness maybe that help
  10. Get the UVmap from a Object into a Canvas

    hi maybe that can help :
  11. CustomMaterial does not work anymore

    Failed to load resource: net::ERR_CONNECTION_REFUSED babylon.shadowOnlyMaterial.js Failed to load resource: the server responded with a status of 404 (Not Found) i download last version and Build in VSCode and Run debug by Playground and have that error * my build out put just have this part [10:51:21] Using gulpfile D:\Git4\Babylon.js\Tools\Gulp\gulpfile.js [10:51:21] Starting 'srcTscWatch'... 10:51:37 AM - Compilation complete. Watching for file changes. [10:51:37] Finished 'srcTscWatch' after 16 s [10:51:37] Starting 'watch'... [10:51:37] Finished 'watch' after 133 ms [10:51:37] Starting 'webserver'... [10:51:37] Webserver started at http://localhost:1338 [10:51:37] Finished 'webserver' after 17 ms [10:51:37] Starting 'run'... [10:51:37] Finished 'run' after 3.32 μs @Deltakosh
  12. CustomMaterial does not work anymore

    @Dad72 i am back to task
  13. CustomMaterial does not work anymore

    i finish 99 percent that need 2 days for PR (i am in travel back in 2 day sorry for late )
  14. CustomMaterial does not work anymore

    remove old_standardVersion under progress
  15. CustomMaterial does not work anymore

    yes absolutly
  16. CustomMaterial and edit textureDynamique

    some time i need stay and just look and don't change it is not good way for programming when you have solution start that fast you most try find better solution *** this is important we can have old version support for our source *** BABYLONJS design pattern don't have any plan for that (maybe i don't know it) so i wanna make new plan for standard material for have customizable that but it is not perfect for now
  17. CustomMaterial does not work anymore

    @Deltakosh i need you commit default shader with #define 's for custom material i make PG for shader tomorrow but i think that fully finished in sunnday and i wanna change that name to CustomableStandardMaterial because i have big plan for CustomMaterial
  18. CustomMaterial does not work anymore

    i try change custom material to new version but have a problem on change vNormalUV i try fix it in base default shader i am on it
  19. GPU particles

    very Nice @Deltakosh
  20. BranchGeometry ( GeometryBuilder )

    a lot stuff can be supported after complete
  21. editor and SVG Path under progress
  22. Custom Vertex Shader + Legacy Material ?

    i try find a way to set uniform (need some time)
  23. Free Augmented Reality App Creator

    i cant register the register button is disable?
  24. Sharing information between fragment shaders

    you read this article i try make more sample
  25. Custom Vertex Shader + Legacy Material ?

    with some hack @Norbz