≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Wow I got plain Vertex Alpha working
Posted by:
(you are not logged in)
Enter the missing letter in: "I?ternational"
(you are not logged in)
Text:
[quote][b]csp-games[/b] wrote: As you may know, CL does offer only the EMT_SOLID_VERTEX_ALPHA_TWO_TEXTURE_BLEND blendmode when it comes to vertex alpha, at least it seems so. After some fiddling I have found a way to have Transparent Vertex alpha from one solid texture to full transparency of the mesh, depending the vertex alpha. [img]https://i.imgur.com/2d7QlHy.png[/img] With this I can implement some really nice effects, like the sunbeams effect I made for directX: [img]https://i.imgur.com/xvy8e0l.jpg[/img] But I'd actually need to render to a small texture, if anybody knows how to render the scene to a texture, pls let me know, thx. I tried, but at some point was getting a serious slap by WebGL itself, complaining it will not allow a rendering feedback loop... that's when you have the rendertarget texture on a mesh that is also rendered. Anyway, here's the experimental code for plain vertex alpha (in add blendmode only so far, but that's what I need for the rays effect anyway): [code] createVertex = function(x, y, z, s, t,s2,t2) { var vtx = new CL3D.Vertex3D(true); vtx.Pos.X = x; vtx.Pos.Y = y; vtx.Pos.Z = z; vtx.TCoords.X = s; vtx.TCoords.Y = t; vtx.TCoords2.X = s2; vtx.TCoords2.Y = t2; // so here I'm setting vertex alpha depending on the Y position of the vertex. RGB has to be somehow halfbright (0x7f7f7f=127,127,127) var al=((y*20)&255)<<24;//(Math.random()*100)<<24; vtx.Color=0x7f7f7f | al;// argb return vtx; } // then in the mat assignement I do just this: buf[i].Mat.Tex1 = engine.getTextureManager().getTexture(txx1[i], true); buf[i].Mat.Type = CL3D.Material.EMT_TRANSPARENT_ALPHA_CHANNEL; // Note this Texture has no alpha channel at all, it's a jpg [/code][/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