≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
shader for web target
Posted by:
(you are not logged in)
Enter the missing letter in: "In?ernational"
(you are not logged in)
Text:
[quote][b][/b] wrote: Cool. You can try using transparent Alpha blend (13) it always worked for me in hlsl shader. I always found hlsl easier than glsl. You can also play with light vectors and light colors to try some more cool effects. Try using ccbSetShaderConstant more often to get the values from the editor and pass it to shader. you can use it like [code]ccbSetShaderConstant (1 "to use with vertex shader" or 2 "to use in fragment(pixel) shader", Name, x,y,z)[/code] you can use it something like this [code]myShaderCallBack = function() { var light = ccbGetSceneNodeFromName("Light1"); var root = ccbGetRootSceneNode(); var lightpos = ccbGetSceneNodeProperty(light,"Position"); var lightcolor =ccbGetSceneNodeProperty(light,"Color"); var Ambientcolor =ccbGetSceneNodeProperty(root,"AmbientLight"); ccbSetShaderConstant(2, 'tile', 1,0,0,0); ccbSetShaderConstant(1, 'light1Pos', lightpos.x,lightpos.y,lightpos.z,0); ccbSetShaderConstant(2, 'light1Color', lightcolor.x,lightcolor.y,lightcolor.z,0); ccbSetShaderConstant(2, 'AmbientColor', Ambientcolor.x,Ambientcolor.y,Ambientcolor.z,0); }[/code] and in your sample you can define tex0,tex1,tex2, or tex4 which will get the textures directly form the editor. with this you can blend up to 4 textures together, for example to blend diffuse,normal,roughness,specular etc textures. shaders are complicated and deals with lot of mathematics and am not at all good with maths *grin* maybe you can create some beautiful shaders with your skills with maths. but yeah shaders are the only thing in game developing which made me goes awww and what, whats going on. I accidentaly created so many cool effects by changing and experimenting in shaders and someimes i was like woah thats a nice effect and sometime i was like what is this. but i enjoyed playing with them. Unfortunately i was unable to save any of them cause i was editing them inside the coppercube editor and was trying to create a very simple color switching shader which i got working somewhat which uses 2 texture one is a color pallete and one is original texture. and if you change the color in the pallete texture it will change the original color textures also. but there was a strange issue with it. it does change the color from the pallete but it automatically switch to different shades of that color. it will either make the color darker or lighter. so i dropped the idea of creating shader. hopefully one day i will try to redo all that stuff.*holy*[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact