they are now fully supported by the 3DM format, it can handle saving and loading GLSL programs. This is not new, but now you can really use those GLSL programs since you have a GLSL code editor within 3DMEditor, so you can edit/create GLSL programs for your objects. Also it now renders using the given shader when there is one (this was missing) and set some variables of GLSL programs to various textures ID.
If you want to use a texture in your GLSL code, you need to declare a sampler2D called tex* where * is the number of the texture it refers to (from 0 to 7 max). * corresponds to the textures in 3DMEditor.
So now we can add nice effects to our models like bump mapping or simulated geometry, etc ... but keep in mind that the more feature you use the less computers will be able to run them. So make sure it still looks good when shaders are not available.
GLSL vertex and fragment programs
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
GLSL vertex and fragment programs
=>;-D Penguin Powered
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
I made a small sphere with a normal map and a small shader:
you can download the object here :
http://www.ta3d.org/files/examples/sphere.3dm
NB: I didn't compress the textures, normal maps don't really like JPEG ...
PS: you'll need current SVN version of 3DMEditor in order to have shader effects ... they were disabled in previous releases
you can download the object here :
http://www.ta3d.org/files/examples/sphere.3dm
NB: I didn't compress the textures, normal maps don't really like JPEG ...
PS: you'll need current SVN version of 3DMEditor in order to have shader effects ... they were disabled in previous releases
=>;-D Penguin Powered
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
I am not really fond of using shaders for metal deposits ... they are basic things on the map, and you can have lots of those to draw on the screen which will slow down rendering ...
and metal deposits are a "critical" component of a map, so we need it to be compatible with older hardware. But if you can make a shader that can be disabled without hurting visual quality, then ok
There is one thing you must keep in mind :
the GLSL shader will take over the whole rendering pipeline, which means you'll have to implement lighting, fog, texturing, etc ... and if you use "odd" textures like normal maps, then disabling the shader will render those textures on the object which will make them look strange
I'll build a package with current SVN, so you can test the new stuffs
and metal deposits are a "critical" component of a map, so we need it to be compatible with older hardware. But if you can make a shader that can be disabled without hurting visual quality, then ok
There is one thing you must keep in mind :
the GLSL shader will take over the whole rendering pipeline, which means you'll have to implement lighting, fog, texturing, etc ... and if you use "odd" textures like normal maps, then disabling the shader will render those textures on the object which will make them look strange
I'll build a package with current SVN, so you can test the new stuffs
=>;-D Penguin Powered
Who is online
Users browsing this forum: No registered users and 20 guests