Download

(39) Rama's Extra Blueprint Nodes for You as a Plugin, No C++ Required!

Ok, I got the ISM node to work. I turned something like 34,000 trees into 1 mesh. Draw calls dropped from 136,000 to ~1500.

I don’t know why it didn’t work the other day, but it seems to do the trick today. Trees kept their LODs and everything seemed to work fine visually.

We seem to have a problem with the trees though, which isn’t necessarily related to your node.

With all those trees instanced in the world using either normal instance, or hierarchical, the FPS is about 4-6. When I use the Victory ISM node the FPS jumps to 15. If I just don’t spawn the trees at all, the FPS is ~55.

I was hoping combining them all into a single ISM would be the answer, but it doesn’t seem to be the case, at least not completely. Will have to investigate possible issues with the trees on this end.

One solution to this is to add an alpha culling in the foliage MAT, i am running some tests at the moment on this.

What is the name of that node in the mat editor?

Posted about this in a separate thread to avoid hijacking this one:

Any advice or tips would be greatly appreciated. Cheers,

J^2

You’re welcome Isaac!

You can add an empty new AActor class with a name of your choosing and that should do the trick, again this should all be different once 4.8 comes along :slight_smile:

I will investigate this as soon as I can! :slight_smile:

Glad to hear there was some improvement, good luck with your tree shader!

Lovely to hear from you Kris, let me know how it goes!

Have fun today everyone!

Rama

**Load Texture 2D From File!

JPG, PNG, BMP, ICO, EXR, and ICNS are Supported File Formats !**

With this node you can load a Texture 2D from a file during runtime!

I output for you the width and height of the loaded image!

Now you can easily create Texture 2D’s from image files in Blueprints, during runtime!

Special Note!

Tim Sweeney liked this node!

Enjoy!

Rama

PS: Make sure to include the file extension when you use this node!

5e04c4d83d602f944fb2cfd946e90787f3b20f70.jpeg


**C++ Code For You**

Here is the core C++ function involved, entire source is in the download! I wrote my own Enum for the file formats.



```


UTexture2D* UVictoryBPFunctionLibrary::Victory_LoadTexture2D_FromFile(const FString& FullFilePath,EJoyImageFormats ImageFormat, bool& IsValid,int32& Width, int32& Height)
{
	IsValid = false;
	UTexture2D* LoadedT2D = NULL;
	
	IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
	
	IImageWrapperPtr ImageWrapper = ImageWrapperModule.CreateImageWrapper(GetJoyImageFormat(ImageFormat));
 
	//Load From File
	TArray<uint8> RawFileData;
	if (!FFileHelper::LoadFileToArray(RawFileData, * FullFilePath)) 
	{
		return NULL;
	}
	
	  
	//Create T2D!
	if (ImageWrapper.IsValid() && ImageWrapper->SetCompressed(RawFileData.GetData(), RawFileData.Num()))
	{ 
		const TArray<uint8>* UncompressedBGRA = NULL;
		if (ImageWrapper->GetRaw(ERGBFormat::BGRA, 8, UncompressedBGRA))
		{
			LoadedT2D = UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight(), PF_B8G8R8A8);
			
			//Valid?
			if (!LoadedT2D) 
			{
				return NULL;
			}
			
			//Out!
			Width = ImageWrapper->GetWidth();
			Height = ImageWrapper->GetHeight();
			 
			//Copy!
			void* TextureData = LoadedT2D->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE);
			FMemory::Memcpy(TextureData, UncompressedBGRA->GetData(), UncompressedBGRA->Num());
			LoadedT2D->PlatformData->Mips[0].BulkData.Unlock();

			//Update!
			LoadedT2D->UpdateResource();
		}
	}
	 
	// Success!
	IsValid = true;
	return LoadedT2D;
}


```



Download Link (6.5mb)

UE4 Wiki, Plugin Download Page

:slight_smile:

Rama

0f36d3a4f869f97b5c23aa7135946654a25f7c74.jpeg

Victory Absolute Paths!
Live as of March 3rd 2015 build

Get the File Path to your project .exe, your project root directory, and more!

These paths are dynamically updated even if you move the entire project to a new location on your computer!

All these nodes are fully compatible with packaged builds and return absolute paths!

These nodes also work in Development/Editor builds!


**More Power For You in BP**

Now you can easily create your own folders/files, relative to the project root directory or your project's .exe!

Please note that in editor builds, the .exe returns your UE4Editor.exe location, but in packaged games it returns your game's .exe

![ca6e47c3de4ce0fc029accc855a97ab3b66c7f0f.jpeg|1260x774](upload://sSMIRl140vUkZisnTkYGaDdAz4X.jpeg)

Recommendation:

I recommend using the Project Game directory for most of your relative path needs! This works the same in Editor and packaged builds!

You can also get your Saved and Logs folders for your project in both packaged and editor builds!

UE4 Wiki, Plugin Download Page

:heart:

Rama

From the Rama Q&A Desk

Hi there!

I just ran some tests with my Config nodes, and I did not have any issues reloading data properly from config file.

Are you sure that you spelled the section name and var name the same way in both places?

It can help to save the section name and var names as string variables so that you just plug them in, guaranteeing that they are the same :slight_smile:

Please try that and if you still have issues let me or one of my assistants (points to the flying unicorns outside the window) know!

Have fun today!

:slight_smile:

Rama

Rama, you’ve definitely been inspiring to us as we play with Unreal 4!

I know it’s not a riveting change but i notice i failed to use proper var names for the float variables. It should be all better now.

Hee hee!

Play and fun are the goal!

:slight_smile:

Rama

Rama Taking BP Node Requests

Does anyone have any BP node requests?

This should be simple utility stuff that could be applicable to many projects.

Functionality you’d eventually like to see added to the engine if possible.

Let me know!

:slight_smile:

Rama

Hi Rama,

Is it possible to take the Pawn Sensing function under actors and make it where it can see 360 degrees around? Right now it seems to be locked at 90 degrees. I’m sure it makes sense for a human to not have peripheral vision going to the back of there head however maybe other creatures may have eyes on the back of there head. :slight_smile:

Also,

Screen Brightness or Gamma. Not sure if this can be done already.

How difficult would it be to add a node that can present 2d image data (aka textures) as an array of vector4s? I would imagine that functionality would be very useful for a lot of people. Just a thought. Cheers,

J^2

For 360 awareness you can use something much simpler, just a distance check! You just want to get all actors of class and do a vector length squared check with your AI unit :slight_smile:

Let me know if this works!

Ah yes, that is on my list :slight_smile:

What do you mean by Vector4s? Are you talking about the Material Editor now? Even though it looks like blueprints that is a completely different system that I cannot so easily add nodes to :slight_smile: If you meant something else let me know!

Do you mean Linear Color when you say Vector4?

You want an image turned into an array of Linear Colors?


Any other requests anyone?

:)

Rama

[COLOR="#0000FF"]Draw Thick Circle With Axis Control[/COLOR]

Fun node for you!

With this node you can draw circles!

And you can control their thickness, as well as how many points make up the circle!

You can also have axis control!

So you can draw circles horizontally, vertically, at angles, any way you like, with convenient BP node inputs!

See pics!

af68277ba636b7e04fc6af9b982616b2340402e4.jpeg

:slight_smile:

Rama

**Get All Screen Resolutions
**
Now works in packaged games!

You can use this with your UMG menus!

It gathers data specific to the end user’s display adapter, including all available refresh rates :slight_smile:

old but has nice in-game pic
3b69b4e4f763cc2f24015fd2abde88cb0e6b00d2.jpeg


**With Refresh Rates**

![d4117a7a04ee5f316cbeae35c6e681739e2c00f8.jpeg|3200x2400](upload://ug2FBEKxxP0mtxmJWbAiVthpvzq.jpeg)

No Refresh Rates!

3975ab3d6a15f4e36483e111fc160973adf7e86d.jpeg

UE4 Wiki, Plugin Download Page

:slight_smile:

Rama

70+ Extra BP Nodes For You!

No c++ required!

No compile required!

Download and plug in!

Latest plugin download is here:

:slight_smile:

Rama

Well I said vector4 since that seems to be how texture data is presented. Basically, I want to be able to get the pixel values of a texture map in a blueprint. For instance, I would like to use a texture map to control placement of actors in a level. As far as I can tell, there’s no way to do that currently. Am I wrong?

J^2

Wow this is a really neat idea!

I will work on getting you the per-pixel data, as an extended version of my Load Image From File node.

:slight_smile:

Rama