Jump to content

Questions : Creating a convincing world ...


Tainder
 Share

Recommended Posts

Hey, I'm actually trying to make this tutorial :

 

http://blogs.msdn.com/b/eternalcoding/archive/2013/08/06/babylon-js-creating-a-convincing-world-for-your-game-with-custom-shaders-height-maps-and-skyboxes.aspx

 

But I've some problems when I want to set the water and the Island. So if you can help me to understand why this doesn't work because i want to create something based on it, so this will help me a lot :).

 

Link of the website : http://lajambobinette.pulseheberg.org/customShaders.html

Link of all files in it : http://sdrv.ms/1dw90qb

 

Thank for you help.

 

Tainder.

Link to comment
Share on other sites

Hello, 

 

Several assets are missing in your scene (error 404 in the JS console - F12 on chrome and IE11).

Be sure to include the texture ground.jpg (you have Ground.jpg in your files, remove the cap on the first letter) and ground/water shaders.

 

You will find all these assets in the zip file downloaded from github, in subfolder Samples\Scenes\WorldMonger

Link to comment
Share on other sites

The .fx files are the vertex and fragments shaders. It is written in GLSL (http://en.wikipedia.org/wiki/OpenGL_Shading_Language) to add a specific effect on a mesh.

This is very well described here : http://blogs.msdn.com/b/eternalcoding/archive/2013/08/06/babylon-js-creating-a-convincing-world-for-your-game-with-custom-shaders-height-maps-and-skyboxes.aspx

Shaders define the code executed by the GPU to process the vertices sent by the meshes and the pixels produced by these vertices.

 

You will need to include the .fx files for water and ground in order to display these specific effect on your scene.

 

Of course, you don't need the vertex and fragment shaders (.fx files) to display a basic scene. If so, I suggest you to use use a different tutorial (https://github.com/BabylonJS/Babylon.js/wiki/Tutorials)

Link to comment
Share on other sites

Just set it in your project. The line using it is in the file waterMaterial.js (line 70).

 

At the root of your project, put bump.png, water.fragment.fx, water.vertex.fx.

In your file waterMaterial.js, update the line 70 with this : 

this._effect = engine.createEffect("water",

instead of : 

this._effect = engine.createEffect("Water/water",

Same for the ground ! 

 

It should work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...