Jump to content

Transparent materials in Sandbox


elcoo
 Share

Recommended Posts

Hi,

I read the transparency and refraction tutorial and I understood that you have to render transparent materials after you rendered the lighted scene, so that you would see lighting effects through the transparent object. How do I achieve this in the sandbox? As far as I know the sandbox already has back and foreground worlds, is that right? Or how else do the atmosphere and particles work?

Link to comment
Share on other sites

Thanks, that helped at least for that problem. I ran right into the next one though I guess. I forgot to mention that I also need alphablending for vegetation. As far as I'm concerned you cannot apply scripts to vegetation, can you?

Edit: Also: Can you set the world for a surface after it is created?

Link to comment
Share on other sites

I would suggest you read the User Guide.

There is an example of the alphatest material file to use with the inherent vegetation that comes with the SDK:

 

texture0="abstract::tree_spruce_leaf_DF.dds"
texture1="abstract::tree_spruce_leaf_N.dds"
texture3="abstract::tree_spruce_leaf_Spec.dds"

specular=0.25
cullface=0

shader="abstract::mesh_diffuse_bumpmap_sway.vert", "abstract::mesh_diffuse_bumpmap_specular_alphatest.frag"
shadowshader="abstract::mesh_shadow_sway.vert","abstract::mesh_shadow.frag"

 

The object scripts basically are only used for the models and not the vegetation mesh layers, but you can have a script for the vegetation if you use them as individual models - it just will not have much effect on the vegetation layer. Unless of course you use the script to change mesh colors.

 

Well you would be creating a mesh and you can set its world after its been created by using SetEntityWorld(), but common practice is to just use SetWorld() prior to creating the mesh.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Thanks for the user guide, that seems to also cover some of the other problems I ran into. I could not find the SetEntityWorld() command in any command reference or even using google. That makes it a bit hard for me to start, as I seemingly cannot find any complete list of commands.

Link to comment
Share on other sites

Its available in lua and bmax... cannot say whether or not its in c/c++. But like I said, most people just set the world prior to creation then set the world back to previous after.

 

As for a command list... there are a couple online as well as found in files in the SDK. Online can be found here and here.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

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.

 Share

×
×
  • Create New...